<template>
	<view>
		<!-- 懒加载动画 -->
		<view class="loading-box">
			<u-loading :show="loadingone" color="#41ADBA" size="70"></u-loading>
		</view>
		<view>
			<!-- <dev-navbar isPageStack @information="information" :bg-color="bgColor"> -->
			<dev-navbar isPageStack :title="pageTitle"></dev-navbar>
			<!-- <navbar :name="pageTitle"></navbar> -->
			<view v-if="pageTitle == '健康数据'">
				<view class="topbg" :class="shareView.chronicDisId?'topbgDis':''">
					<view class="facility">
						<scroll-view scroll-x="true" v-if="hisUserId == ''">
							<block v-for="(item,idx) in bdList" :key="idx">
								<view class="view_biy" @click="topBd(item,idx)">
									<image class="biy_img" :src="item.image"></image>
									{{item.title}}
								</view>
							</block>
						</scroll-view>
						<!-- 选择类型 -->
						<swiper class="swiper" :current='swiperIndex' :circular="true" :previous-margin="'200rpx'"
							:next-margin="'200rpx'" @change="swiperChange">
							<!-- swiperArr -->
							<block v-for="(item,idx) in AddArr" :key="idx">
								<swiper-item>
									<!-- :style="'background:'+item.background" -->
									<!-- ,item.itemCode -->
									<view class="itemview" :class="[swiperIndex == idx?'conter':'']"
										:style="'background: linear-gradient(180deg,'+ item.backgroundOne+' 0%,'+item.backgroundTwo+' 100%);'">
										<view class="weui-flex">
											<view>
												<view class="placeholder">
													<image class="itemImage" :src="item.smallIcon"></image>
												</view>
											</view>
											<view class="weui-flex__item">
												<view class="placeholder itemTitle">
													记录{{item.indicName}}
												</view>
											</view>
										</view>
										<view class="bgfView">
											<view class="weui-flex">
												<view class="weui-flex__item">
													<view class="placeholder">
														<view class="ctitle1">
															<view v-if="itemCode == 'BLOOD_SUGAR'&&swiperIndex == idx">
																{{BLOODVALUE}}
															</view>
															<view v-else>
																{{item.itemCode!= 'HEART_RATE'&&item.itemCode!='BLOOD_PRESSURE'?'今日':''}}{{item.itemCode =='BLOOD_PRESSURE'?item.recordDesc.split('/')[0]:item.indicName}}
															</view>
														</view>
														<view
															v-if="price1 != ''&&swiperIndex == idx||item.itemCode == 'SLEEP'&&price2!=''&&swiperIndex == idx">
															{{price1||''}}<text class="unit1">{{item.unit}}</text>
															{{item.itemCode == 'SLEEP'?price2:''}}<text
																class="unit1">{{item.itemCode == 'SLEEP'?item.unit1:''}}</text>
														</view>
														<view v-else class="bloodGlucose">
														</view>
													</view>
												</view>
												<view class="weui-flex__item" v-if="item.unit == 'mmHg'">
													<view class="placeholder">
														<view class="ctitle1">
															{{item.itemCode =='BLOOD_PRESSURE'?item.recordDesc.split('/')[1]:item.indicName}}
														</view>
														<view v-if="price2 != ''&&swiperIndex == idx">
															{{price2}}<text class="unit1">{{item.unit}}</text>
														</view>
														<view v-else class="bloodGlucose">
														</view>
													</view>
												</view>
											</view>
											<!-- :style="item.btnbg" -->
											<!-- :class="item.itemCode+'btn'" -->
											<button type="default" class="itemButton"
												:style="'background: linear-gradient(180deg,'+ item.backgroundOne+' 0%,'+item.backgroundTwo+' 100%);'"
												@tap.stop="handleTap('picker3')"><text>
													去记录
												</text></button>
											<!-- :style="item.btnbg" -->
											<view class="dot" :class="'btnbg'+idx">
												<!-- :style="item.borcolor" -->
												<!-- :class="item.itemCode+'li'" -->
												<view class="line"
													:style="'border-bottom: 1px dashed '+ item.backgroundTwo+';'">
												</view>
												<!-- :style="item.btnbg" -->
												<!-- :class="item.itemCode+'btn'" -->
												<view
													style="width: 100%;height: 100%;position: absolute;border-radius: 50%;"
													:style="'background: linear-gradient(180deg,'+ item.backgroundOne+' 0%,'+item.backgroundTwo+' 100%);'">
												</view>
											</view>
										</view>
									</view>
								</swiper-item>
							</block>
						</swiper>
						<!-- end -->
					</view>
				</view>
			</view>
			<view v-if="pageTitle == '我的家人'">
				<view class="familybg">
					<!-- 亲友头像部分 -->
					<view class="dear-flex" v-if="hisUserId !=''">
						<image class="qyimage" :src="qyuserdata.avatarUrl">
						</image>
						<!-- <image v-if="item.relationName =='父亲'" class="qyimage" mode="aspectFit"
							src="https://bsyjk-pic.bsyjk.cn/fatherImage/419D40B313EC4FB7A56F45C839279507.png">
						</image>
						<image v-if="item.relationName =='母亲'" class="qyimage" mode="aspectFit"
							src="https://bsyjk-pic.bsyjk.cn/motherImage/110DD0CAB962479A992679793A5818CC.png">
						</image>
						<image v-if="item.relationName =='伴侣'" class="qyimage" mode="aspectFit"
							src="https://bsyjk-pic.bsyjk.cn/partnerImage/D5363339740B43A4B7855A6104E3B8B0.png">
						</image>
						<image v-if="item.relationName =='女儿'" class="qyimage" mode="aspectFit"
							src="https://bsyjk-pic.bsyjk.cn/girlImage/72CE9F1F273D42B9834D93CFE37FF843.png">
						</image>
						<image v-if="item.relationName =='儿子'" class="qyimage" mode="aspectFit"
							src="https://bsyjk-pic.bsyjk.cn/sonImage/0BAC659F61A442428E005326C7AA4A06.png">
						</image>
						<image v-if="item.relationName =='自己'" class="qyimage" mode="aspectFit"
							:src="item.gender == 1?'https://bsyjk-pic.bsyjk.cn/partnerImage/D5363339740B43A4B7855A6104E3B8B0.png':'http://static.bsyjk.cn/woman/4F85514265FA416CB88EB3C9D782DE67.png'">
						</image>
						<image v-if="item.relationName !='自己'&&item.relationName !='父亲'&&item.relationName !='母亲'
						&&item.relationName !='伴侣'&&item.relationName !='女儿'&&item.relationName !='儿子'
						&&item.relationName !='添加'" class="qyimage" mode="aspectFit"
							src="https://bsyjk-pic.bsyjk.cn/customImage/7881F937917C4299B6BE3B4A835E4E51.png">
						</image> -->
						<view class="user-viuew" :class="true?'actavesm':''">
							<view class="qinyou-name">
								<view style="width: 120upx;float: left;" class="ellipsis">
									{{qyuserdata.relationName}}
								</view>
								<view class="userjibingn">
									<view class="nammebjb" v-for="(itema,idxa) in qyuserdata.diseaseName" :key="idxa">
										{{itema.diseaseName}}
									</view>
									<button :disabled="qyuserdata.remindFlag == 1" @tap="remind(qyuserdata)"
										:class="qyuserdata.remindFlag == 1?'nammebjb2':'nammebjb'"
										style="display: block;float: right;"
										v-if="qyuserdata.diseaseName.length == 0">提醒他</button>
								</view>
							</view>
							<view class="qinyou-content">
								<view style="width: 120upx;float: left;" class="ellipsis">
									{{qyuserdata.remark}}
								</view>
								<view class="nonebaogao">
									{{qyuserdata.diseaseName.length == 0?'暂无健康报告':''}}
								</view>
							</view>
						</view>
					</view>
					<!-- 家人选择 -->
					<view style="width: 750upx;">
						<u-tabs duration="1" height="100" bg-color="none" font-size="30rpx" active-color="#81C042"
							inactive-color="#fff" :list="AddArr" :is-scroll="true" :current="currentIndex"
							@change="tabsChange"></u-tabs>
					</view>
				</view>
			</view>
			<!-- 分享 -->
			<template v-if="shareFlag != 1">
				<fissionPoster :PosteritemCode="itemCode" @shareFun="shareFun"></fissionPoster>
			</template>
			<!-- 血压 -->
			<view class="missionView" :style="{'margin-top':`${shareFlag==1?-140:0}rpx`}" v-if="itemCode == 'BLOOD_PRESSURE'&&oneResult.indicGrade&&oneResult.advise">
				<view class="fxw670">
					<view class="causeTitle">
						{{oneResult.indicGrade}}
					</view>
					<view class="causeContent">
						{{oneResult.advise}}
					</view>
				</view>
			</view>
			<!-- 饮食 -->
			<view class="missionView" v-if="itemCode == 'DIET'&&dietArr.length!= 0">
				<view>
					<block v-for="(item,idx) in dietArr" :key="idx">
						<view class="weui-flex foodstyle" @tap="addtap('ydk',item)">
							<view>
								<view class="placeholder">
									<image class="foodImage" :src="item.foodUrl"></image>
								</view>
							</view>
							<view class="weui-flex__item">
								<view class="placeholder">
									<view class="wtitle ellipsis">
										{{item.foodName}}
									</view>
									<text class="itmweight">{{item.intakeWeight}}g</text><text
										class="itmweight">{{item.heatQuantity}}千卡</text>
								</view>
							</view>
							<view>
								<view class="placeholder">
									<view class="arrows">
									</view>
								</view>
							</view>
						</view>
					</block>
				</view>
			</view>
			<!-- 运动 -->
			<view class="missionView" v-if="itemCode == 'MOTION'&&dietArr.length!= 0">
				<view>
					<block v-for="(item,idx) in dietArr" :key="idx">
						<view class="weui-flex foodstyle" @tap="addtap('ydklist',item)">
							<view>
								<view class="placeholder">
									<image class="foodImage" :src="item.sportUrl"></image>
								</view>
							</view>
							<view class="weui-flex__item">
								<view class="placeholder">
									<view class="wtitle ellipsis">
										{{item.sportName}}
									</view>
									<text class="itmweight">{{item.sportTimeLen}}</text><text
										class="itmweight">{{item.heatQuantity}}千卡</text>
								</view>
							</view>
							<view>
								<view class="placeholder">
									<view class="arrows">
									</view>
								</view>
							</view>
						</view>
					</block>
				</view>
			</view>
			<view class="missionView" v-if="itemCode == 'WEIGHT'||itemCode == 'SLEEP'">
				<view class="fxw670">
					<view class="weui-flex topxxiys" v-show="itemCode == 'WEIGHT'">
						<view class="weui-flex__item">
							<view class="placeholder">
								<view>
									<text class="titleS">BMI</text>{{oneResult.bmi?oneResult.bmi:'--'}}
								</view>
								<view>
									<text class="titleS">体脂率</text>{{oneResult.bodyfat?oneResult.bodyfat:'--'}}%
								</view>
							</view>
						</view>
						<view class="weui-flex__item">
							<view class="placeholder">
								<view>
									<text class="titleS">骨骼</text>{{oneResult.muscle?oneResult.muscle:'--'}}kg
								</view>
								<view>
									<text class="titleS">肌肉量</text>{{oneResult.muscleMass?oneResult.muscleMass:'--'}}kg
								</view>
							</view>
						</view>
						<view class="weui-flex__item">
							<view class="placeholder ellipsis">
								<view>
									<text class="titleS">基础新陈代谢</text>{{oneResult.bmr?oneResult.bmr:'--'}}kcal
								</view>
								<view>
									<text class="titleS">水分率</text>{{oneResult.water?oneResult.water:'--'}}%
								</view>
							</view>
						</view>
					</view>
					<view class="weui-flex topxxiys" v-show="itemCode == 'SLEEP'">
						<view class="weui-flex__item">
							<view class="placeholder">
								<view>
									<text class="titleS">深度睡眠</text>--
								</view>
								<view>
									<text class="titleS">清醒时长</text>--
								</view>
							</view>
						</view>
						<view class="weui-flex__item">
							<view class="placeholder">
								<text class="titleS">浅睡眠</text>--
							</view>
						</view>
					</view>
					<view class="causeTitle" v-if="itemCode!= 'DIET'&&itemCode!= 'MOTION'&&oneResult.indicGrade">
						{{oneResult.indicGrade}}
					</view>
					<view class="causeContent" v-if="itemCode!= 'DIET'&&itemCode!= 'MOTION'&&oneResult.indicGrade">
						{{oneResult.advise}}
					</view>
				</view>
			</view>
			<!-- end -->
			<!-- 图表 -->
			<view v-show="resultList != null"
				style="width: 717upx; margin: 30upx auto 40upx;background: #fff;border-radius: 20upx;">
				<!-- 血脂四项 -->
				<view class="switch-flex"
					v-if="itemCode == 'FOUR_ITEMS_BLOOD_LIPID'||itemCode == 'BLOOD_SUGAR'||itemCode == 'WEIGHT'">




					<view class="flex-leftTitle">
						<text v-if="itemCode == 'FOUR_ITEMS_BLOOD_LIPID'">血脂走势</text>
						<text v-if="itemCode == 'BLOOD_SUGAR'">血糖走势</text>
						<text v-if="itemCode == 'WEIGHT'">体重走势</text>
					</view>
					<view class="r-flexTab">
						<view class="tab-view" v-for="(item,index) in tablist" :key="index" @tap.stop="tapf2(index)"
							:class="ltabindex==index?'actavetab':''">
							{{item.name}}
						</view>
					</view>
				</view>
				<view style="width 670upx;height: 500rpx;">
					<l-f2 ref="chart"></l-f2>
				</view>
				<view style="height: 20rpx;">

				</view>
			</view>

			<!-- end -->
			<!-- 数据 -->
			<!-- 饮食 -->
			<view class="pressView" v-if="itemCode == 'DIET'">
				<block v-for="(item,idx) in resultList" :key="idx">
					<view class="weui-flex">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								{{item.recordTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty" style="padding-right: 26upx;">
								摄入{{item.heatQuantity}}千卡
							</view>
						</view>
						<view>
						</view>
					</view>
					<u-line class="u-line"></u-line>
				</block>
			</view>
			<!-- end -->
			<!-- 运动 -->
			<view class="pressView" v-if="itemCode == 'MOTION'">
				<block v-for="(item,idx) in resultList" :key="idx">
					<view class="weui-flex">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								{{item.createTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty" style="padding-right: 26upx;">
								消耗{{item.heatQuantity}}千卡
							</view>
						</view>
						<view>
						</view>
					</view>
					<u-line class="u-line"></u-line>
				</block>
			</view>
			<!-- end -->
			<!-- 心率 -->
			<view class="pressView" v-if="itemCode == 'HEART_RATE'">
				<block v-for="(item,idx) in resultList" :key="idx">
					<view class="weui-flex">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								{{item.createTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty">
								{{item.heartRateValue}}次/分
							</view>
						</view>
						<view>
							<view class="placeholder type_sty" :style="'color:'+item.color">
								{{item.indicGrade}}
							</view>
						</view>
					</view>
					<u-line class="u-line"></u-line>
				</block>
			</view>
			<!-- end -->
			<!-- 血氧  糖化血红蛋白 尿酸 同型半胱氨酸 臀围 腰围-->
			<view class="pressView"
				v-if="itemCode == 'BLOOD_OXYGEN'||itemCode == 'GLYCOSYLATED_HEMOGLOBIN'||itemCode == 'URIC_ACID'||itemCode == 'HOMOCYSTEINE'||itemCode == 'HIPLINE'||itemCode == 'WAIST'">
				<block v-for="(item,idx) in resultList" :key="idx">
					<view class="weui-flex">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								{{item.createTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty">
								{{item.value}}
								<text v-if="itemCode == 'HIPLINE'||itemCode == 'WAIST'">cm</text>
								<text v-if="itemCode == 'BLOOD_OXYGEN'||itemCode == 'GLYCOSYLATED_HEMOGLOBIN'">%</text>
								<text v-if="itemCode == 'URIC_ACID'||itemCode == 'HOMOCYSTEINE'">μmol/L</text>
							</view>
						</view>
						<!-- :class="[item.indicGrade=='偏高'||item.indicGrade=='优'||item.indicGrade=='超重'?'colorF3':'',
								item.indicGrade=='正常'?'color8':''||item.indicGrade=='良'?'color8':'',
								item.indicGrade=='偏低'||item.indicGrade=='差'||item.indicGrade=='过低'?'color2':'',
								item.indicGrade=='中'||item.indicGrade=='肥胖'?'colorff9':''||item.indicGrade=='极高'?'colorff92':'']" -->
						<view>
							<view class="placeholder type_sty ellipsis" style="max-width: 250rpx;"
								:style="'color:'+item.color">
								{{item.indicGrade}}
							</view>
						</view>
					</view>
					<u-line class="u-line"></u-line>
				</block>
			</view>
			<!-- 血压 -->
			<view class="pressView" v-if="itemCode == 'BLOOD_PRESSURE'">
				<block v-for="(item,idx) in resultList" :key="idx">
					<view class="weui-flex">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								{{item.createTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty">
								{{item.systolicPre}}/{{item.diastolicPre}}mmHg
							</view>
						</view>
						<!-- :class="[item.indicGrade=='偏高'||item.indicGrade=='优'||item.indicGrade=='超重'?'colorF3':'',
								item.indicGrade=='正常'?'color8':''||item.indicGrade=='良'?'color8':'',
								item.indicGrade=='偏低'||item.indicGrade=='差'||item.indicGrade=='过低'?'color2':'',
								item.indicGrade=='中'||item.indicGrade=='肥胖'?'colorff9':''||item.indicGrade=='极高'?'colorff92':'']" -->
						<view>
							<view class="placeholder type_sty " :style="'color:'+item.color">
								{{item.indicGrade}}
							</view>
						</view>
					</view>
					<u-line class="u-line"></u-line>
				</block>
			</view>
			<!-- end -->
			<!-- 体重 -->
			<view class="pressView" v-if="itemCode == 'WEIGHT'">
				<block v-for="(item,idx) in resultList" :key="idx">
					<view class="weui-flex" @tap="rotateTap(item,idx)">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								{{item.createTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty">
								<text v-if="ltabindex == 0">{{item.weight}} kg</text>
								<text v-if="ltabindex == 1" style="padding-right: 40rpx;">{{item.bodyfat||'-'}}{{item.bodyfat?'%':''}}</text>
								<text v-if="ltabindex == 2" style="padding-right: 40rpx;">{{item.muscleMass||'-'}}{{item.muscleMass?'kg':''}}</text>
							</view>
						</view>
						<view>
							<!-- :class="[item.indicGrade=='偏高'||item.indicGrade=='优'||item.indicGrade=='超重'?'colorF3':'',
								item.indicGrade=='正常'?'color8':''||item.indicGrade=='良'?'color8':'',
								item.indicGrade=='偏轻'||item.indicGrade=='偏低'||item.indicGrade=='差'||item.indicGrade=='过低'?'color2':'',
								item.indicGrade=='中'||item.indicGrade=='肥胖'?'colorff9':'',item.rotate?'weightArrowRotate':'']"-->
							<view v-if="ltabindex == 0" class="placeholder type_sty weightArrow"
								:style="'color:'+item.color">
								{{item.indicGrade}}
							</view>
						</view>
					</view>
					<u-line class="u-line"></u-line>
					<view class="missionView" v-if="item.rotate">
						<view class="fxw670">
							<view class="weui-flex topxxiys" style="line-height: 51rpx;">
								<view class="weui-flex__item">
									<view class="placeholder">
										<view>
											<text class="titleS">BMI</text>{{item.bmi?item.bmi:'--'}}
										</view>
										<view>
											<text class="titleS">体脂率</text>{{item.bodyfat?item.bodyfat:'--'}}
										</view>
									</view>
								</view>
								<view class="weui-flex__item">
									<view class="placeholder">
										<view>
											<text class="titleS">骨骼</text>{{item.muscle?item.muscle:'--'}}kg
										</view>
										<view>
											<text class="titleS">肌肉量</text>{{item.muscleMass?item.muscleMass:'--'}}kg
										</view>
									</view>
								</view>
								<view class="weui-flex__item">
									<view class="placeholder ellipsis">
										<view>
											<text class="titleS">基础新陈代谢</text>{{item.bmr?item.bmr:'--'}}kcal
										</view>
										<view>
											<text class="titleS">水分率</text>{{item.water?item.water:'--'}}%
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</block>
			</view>
			<!-- end -->
			<!-- 睡眠 -->
			<view class="pressView" v-if="itemCode == 'SLEEP'">
				<block v-for="(item,idx) in resultList" :key="idx">
					<view class="weui-flex">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								{{item.recordTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty">
								{{item.sleepTimeLen2}}
							</view>
						</view>
						<view>
							<!--:class="[item.indicGrade=='过度'?'colorF3':'',item.indicGrade=='良好'?'color8':'',
								item.indicGrade=='不足'?'color2':'',
								item.indicGrade=='一般'?'colorff9':'']" -->
							<view class="placeholder type_sty" :style="'color:'+item.color">
								{{item.indicGrade}}
							</view>
						</view>
					</view>
					<u-line class="u-line"></u-line>
				</block>
			</view>
			<!-- end -->
			<!-- 血脂四项 -->
			<view class="pressView" v-if="itemCode == 'FOUR_ITEMS_BLOOD_LIPID'">
				<block v-for="(item,idx) in resultList" :key="idx">
					<view class="weui-flex" v-show="ltabindex == 0">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								<!-- 甘油三酯 -->
								{{item.createTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty">
								{{item.value}}mmol/L
							</view>
						</view>
						<view>
							<view class="placeholder type_sty" :style="'color:'+item.color">
								{{item.indicGrade}}
							</view>
						</view>
					</view>
					<!--高密度脂蛋白（HDL）  -->
					<view class="weui-flex" v-if="ltabindex == 1">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								<!-- 高密度脂蛋白（HDL） -->
								{{item.createTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty">
								{{item.value}}mmol/L
							</view>
						</view>
						<view>
							<view class="placeholder type_sty" :style="'color:'+item.color">
								{{item.indicGrade}}
							</view>
						</view>
					</view>
					<!-- 低密度脂蛋白（LDL） -->
					<view class="weui-flex" v-if="ltabindex == 2">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								<!-- 低密度脂蛋白（LDL） -->
								{{item.createTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty">
								{{item.value}}mmol/L
							</view>
						</view>
						<view>
							<view class="placeholder type_sty" :style="'color:'+item.color">
								{{item.indicGrade}}
							</view>
						</view>
					</view>
					<!-- 总胆固醇 -->
					<view class="weui-flex" v-if="ltabindex == 3">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								<!-- 总胆固醇 -->
								{{item.createTime}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty">
								{{item.value}}mmol/L
							</view>
						</view>
						<view>
							<view class="placeholder type_sty" :style="'color:'+item.color">
								{{item.indicGrade}}
							</view>
						</view>
					</view>
					<u-line class="u-line"></u-line>
				</block>
			</view>
			<!-- end -->
			<view class="pressView" v-if="false">
				<block v-for="(item,idx) in pressList" :key="idx">
					<view class="weui-flex">
						<view class="weui-flex__item">
							<view class="placeholder time_sty">
								{{item.time}}
							</view>
						</view>
						<view>
							<view class="placeholder num_sty">
								{{item.num}}
							</view>
						</view>
						<view>
							<!--:class="[item.type=='偏高'||item.type=='优'||item.type=='超重'?'colorF3':'',
								item.type=='正常'?'color8':''||item.type=='良'?'color8':'',
								item.type=='偏低'||item.type=='差'||item.type=='过低'?'color2':'',
								item.type=='中'||item.type=='肥胖'?'colorff9':'']" -->
							<view class="placeholder type_sty" :style="'color:'+item.color">
								{{item.type}}
							</view>
						</view>
					</view>
					<u-line class="u-line"></u-line>
				</block>
			</view>
			<!-- end -->
			<!-- 血糖表格 -->
			<!--  -->
			<view class="tableView" v-if="itemCode == 'BLOOD_SUGAR'&&xyformtime.length !=0">
				<view class="tableTltle">
					近{{xyformtime.length}}天记录
				</view>
				<view class="weui-flex">
					<view>
						<view class="placeholder">
							<view class="tabteshud">
								<text>
									日
									期
								</text>
							</view>
							<u-table>
								<block v-for="(item,idx) in xyformtime" :key="idx">
									<u-tr>
										<u-td>{{item.recordTime}}</u-td>
									</u-tr>
								</block>
							</u-table>
						</view>
					</view>
					<view class="weui-flex__item">
						<view class="placeholder">
							<u-table>
								<u-tr>
									<u-th>早餐</u-th>
									<u-th>午餐</u-th>
									<u-th>晚餐</u-th>
								</u-tr>
								<u-tr>
									<u-td>前</u-td>
									<u-td>后</u-td>
									<u-td>前</u-td>
									<u-td>后</u-td>
									<u-td>前</u-td>
									<u-td>后</u-td>
								</u-tr>
							</u-table>
							<u-table>
								<block v-for="(item,idx) in xyformtime" :idx="idx" :key="idx">
									<u-tr>
										<u-td v-for="(items,idxs) in item.xyformtime1" :key="idxs"
											:class="[items.indicStatus==2?'adddersss':'',items.indicStatus==3?'ladersss':'']">
											{{items.sugarValue}}
										</u-td>
									</u-tr>
								</block>
							</u-table>
						</view>
					</view>
					<view>
						<view class="placeholder">
							<view class="tabteshud">
								<text>
									凌
									晨
								</text>
							</view>
							<u-table>
								<block v-for="(item,idx) in xyformtime" :idx="idx" :key="idx">
									<u-tr>
										<u-td v-for="(items,idxs) in item.xyformtime6" :key="idxs">{{items.sugarValue}}
										</u-td>
									</u-tr>
								</block>
							</u-table>
						</view>
					</view>
				</view>
				<view>

				</view>
				<view class="tableTltle">
				</view>
			</view>
			<!-- end -->
			<view v-if="!resultList || resultList.length <=0"
				style="text-align: center;color: #9B9B9B;font-size: 30upx;">
				<view class="noDataicon">
				</view>
				暂无数据
			</view>
			<view style="height: 100upx;">
			</view>
			<u-popup mode="center" v-model="popupshow" border-radius="14">
				<view class="popupContent">
					<view class="popupTitle">
						指标选择
						<view class="popupClickno" @click="popupshow=false">

						</view>
					</view>
					<scroll-view scroll-y="true" class="popupAddview">
						<view class="popupAdd">
							默认
						</view>
						<view class="AddBody">
							<block v-for="(item,idx) in AddArr" :key="idx">
								<view class="addView" v-if="item.defaultFlag ==1"
									:class="item.defaultFlag !=1?'addView_b':''" @tap.stop="deletaddview(item,idx)">
									{{item.indicName}}
								</view>
							</block>
						</view>
						<view class="popupAdd">
							已添加
						</view>
						<view class="AddBody">
							<block v-for="(item,idx) in AddArr" :key="idx">
								<view class="addView" style="background-color: rgba(129, 192, 66, 1);color: #fff;"
									v-if="item.defaultFlag !=1&&item.chooseFlag==1"
									:class="item.defaultFlag !=1&&item.chooseFlag==1?'addView_b':''"
									@tap.stop="deletaddview(item,idx)">
									{{item.indicName}}
								</view>
							</block>
						</view>
						<view class="popupNoadd">
							未添加
						</view>
						<view class="noAddbody">
							<block v-for="(item,idx) in noAddarr" :key="idx">
								<view class="noaddView" style="color: #fff;" @tap.stop="addh(item)">
									<u-icon name="plus-circle-fill"></u-icon> <text
										style="padding-left: 10upx;">{{item.indicName}}</text>
								</view>
							</block>
						</view>
					</scroll-view>

				</view>
			</u-popup>
			<lb-picker ref="picker3" v-model="value3" mode="selector" :list="list3" :dataset="{ name: 'label3' }"
				@change="handleChange" @confirm="handleConfirm" @cancel="handleCancel" :shade="true" :cancelView="true">
			</lb-picker>
		</view>
		<!-- end -->
		<!-- 饮食删除  修改 -->
		<selecta ref="ydk" @switchTime="switchTime"
			:timeValue="value1==''||endTime==value1?'今日':value1.replace(/-/g,'.')" :checkedData="checkedData"
			@scrollLeftNow="scrollLeftNow" @formFood="formFood" :typePage="2"></selecta>
		<lb-picker ref="picker1" v-model="value1" mode="dateSelector" @change="handleChange" @confirm="handleConfirmys"
			@cancel="handleCancel" :start-date="startTime" :end-date="endTime">
		</lb-picker>
		<selecta ref="ydklist" yundongys="yd" @switchTime="switchTime
		  " @formFood="formFood" :checkedData="checkedData"
			:timeValue="value1==''||endTime==value1?'今日':value1.replace(/-/g,'.')" @scrollLeftNow="scrollLeftNow"
			:typePage="2">
		</selecta>
	</view>
</template>
<script>
import F2 from '@/uni_modules/lime-f2/components/l-f2/f2-all.min.js';
import lF2 from '@/uni_modules/lime-f2/components/l-f2/l-f2.vue';
	import selecta from '@/pages/subpackage/components/lb-picker/select';
	import lbPicker  from '@/pages/subpackage/components/lb-picker/index';
	import fissionPoster from '../../components/fission-poster/index.vue';
	import uLoading from "@/uview-ui/components/u-loading/u-loading.vue"
import uLine from "@/uview-ui/components/u-line/u-line.vue"
import uTabs from "@/uview-ui/components/u-tabs/u-tabs.vue"
import uPopup from "@/uview-ui/components/u-popup/u-popup.vue"


import uTable from "@/uview-ui/components/u-table/u-table.vue"
import uTr from "@/uview-ui/components/u-tr/u-tr.vue"
import uTh from "@/uview-ui/components/u-th/u-th.vue"
import uTd from "@/uview-ui/components/u-td/u-td.vue"
import uIcon from "@/uview-ui/components/u-icon/u-icon.vue"

	export default {
		components: {
			uLoading,
			uLine,
			uTabs,
			uTable,
			uTr,
			uTh,
			uTd,
			uIcon,
			uPopup,
			lF2,
			selecta,
			fissionPoster,
			lbPicker
		},
		data() {
			return {
				shareFlag:0,//分享标志 1需要分享 2不需要
				shareView:{},//用户id
				standardList: [], //去重后list
				currentIndex: 0,
				onShowTime: [],
				defsResult7: [],
				childDeviceType: ['INDIC_BLOOD_TG', 'INDIC_BLOOD_HDL_C', 'INDIC_BLOOD_LDL_C',
					'INDIC_BLOOD_TC'
				], //甘油三酯 HDL LDL 总胆固醇
				surfaceData: {},
				ltabindex: 0,
				tablist: [],
				tablistArr: [
					[{
						name: '甘油三酯',
						key: 'triglyceride'
					}, {
						name: 'HDL',
						key: 'topLipoprotein'
					}, {
						name: 'LDL',
						key: 'lowLipoprotein'
					}, {
						name: '总胆固醇',
						key: 'cholesterol'
					}],
					[{
						name: '体重',
						key: 'weight'
					}, {
						name: '体脂率',
						key: 'bodyfat'
					}, {
						name: '肌肉量',
						key: 'muscleMass'
					}],
					[{
						name: '空腹/餐前',
						key: '1-3-5'
					}, {
						name: '餐后',
						key: '2-4-6'
					}, {
						name: '凌晨',
						key: '7'
					}]
				],
				resultListlength: 0,
				dayValue: 100,
				current: 0,
				pageTitle: '健康数据',
				BLOODVALUE: '刚刚',
				startTime: '2020-12-31', //记录开始时间
				endTime: this.$basejs.thisdayFormat2(false), //今日
				value1: '', //时间
				checkedData: {}, //饮 运动
				qyuserdata: '', //亲友数据
				hisUserId: '', //他人userid
				loadingone: false, //懒加载动画
				xyformtime: [], //心率
				today: this.$basejs.thisdayFormat2(false),
				resultArr: [], //全部数据
				resultList: [], //7日数据
				price1: '',
				unit1: '',
				price2: '',
				unit2: '',
				itemCode: '',
				oneResult: '', //一天数据
				indicId: '', //指标id
				value: 0,
				data: [

				],
				value3: '',
				label3: '',
				list3: ['设备录入', '手动录入'],
				noAddarr: [],
				AddArr: [],
				popupshow: false,
				dietArr: [],
				pressList: [],
				swiperIndex: 0,
				swiperArr: [],
				list: [],
				bdList: [{
						image: 'http://static.bsyjk.cn/addsbicon/DDB692B8D3BF44A6A42F0340E8C6EE01.png',
						title: '绑定设备',

					},
					{
						image: 'http://static.bsyjk.cn/zhibiaoxunaze/7A7F1258EF7446748A833B8AEC4D5E00.png',
						title: '指标选择'
					}
				],
				Suctionscreen: false,
				background: {
					backgroundImage: 'linear-gradient(112deg, #81C042 0%, #2EA7E0 100%)'
				},
			}
		},
		onLoad(e) {
			console.log(e.shareFlag,"---------------555555555555555555-----------")
			this.shareFlag = e.shareFlag
			if (e.scene) { //通过扫码进入
				// e.scene = 'scene=98,BLOOD_PRESSURE'
				let scene = decodeURIComponent(e.scene);
				let arr = scene.split(',');
				let hisId = arr[0]; //code
				let hisCode = arr[1]; //跳转那个页
				console.log('detail scene: ', arr, scene, hisId, hisCode)
				uni.setStorageSync('extenUserId', hisId)
				uni.setStorageSync('deviceTypeYq', hisCode)
				if(global.token){
					this.saveByq()
				}else{
					this.$urouter.navigateTo({
						url: '/pages/signIn/signIn',
						params: {
							jumpInterface:'/pages/subpackage/home/healthData/healthData',
							transferParameters:JSON.stringify(e)
						}
					});
				}
			}
			this.pageTitle = e.pageTitle ? e.pageTitle : '健康数据'; //是否是我的家人页面
			this.hisUserId = e.hisUserId ? e.hisUserId : ''
			if (e.hisUserId) {
				this.familyInfo()
			}
			this.indicId = e.indicId;
			this.userIndicators(); //获取用户自定也指标
			this.getRangeIndicator() //测量指标范围列表
		},
		mounted() {

			const data = []
			this.$refs.chart.init(config => {
				config.padding = ['auto', 'auto', 'auto', 70]

				const chart = new F2.Chart(config);
				chart.source(data, {
					day: {
						min: 1,
						max: 24
					}
				});
				chart.line().position('day*value');
				chart.point().position('day*value').style({
					lineWidth: 1,
					stroke: '#fff'
				});
				chart.interaction('pan');
				// 定义进度条
				chart.scrollBar({
					mode: 'x',
					xStyle: {
						offsetY: -5
					}
				});
				chart.render();
				return chart;
			});
		},
		onShow() {
			let itemCode = this.itemCode;
			if (itemCode) {
				this.record(itemCode, 200)
			}
		},
		methods: {
			shareFun(data){
				this.shareView = data
			},
			saveByq(newUserFlag) {
				let extenUserId = uni.getStorageSync('extenUserId'),
					deviceTypeYq = uni.getStorageSync('deviceTypeYq')
				this.$api.post(global.apiUrls.saveByq, {
					extenUserId: extenUserId, //邀请人id
					newUserFlag: newUserFlag ? newUserFlag : 0, //这个页面默认不是新用户
					deviceType: deviceTypeYq //邀请类型
				}).then(res => { //邀请成功
					if (res.data.code == 1000) {
						uni.showToast({
							title: '加入成功',
							duration: 3000
						});
						if (extenUserId) {
							uni.removeStorageSync('extenUserId')
						}
						if (deviceTypeYq) {
							uni.removeStorageSync('deviceTypeYq')
						}
					} else {
						uni.showToast({
							title: res.data.message,
							icon: 'none',
							duration: 3000
						});
					}
				})
			},
			// 获取百分比数
			reduceNUm(num1, num2, isParseInt) {
				let num = num1 * num2
				if (!isParseInt) { //默认为整数
					num = parseInt(num)
				}
				console.log(num, 978)
				return num
			},
			// 对比大小
			maxMin(data, data2, num1, num2, maxmin) { //对比数据 1 对比数据2 key 1 kye 2  true 大
				let num
				if (maxmin) { //true 小于
					if (data[num1] < data2[num2]) { //标准值小于 用户输入值
						num = data[num1]
					} else {
						num = data2[num2]
					}
				} else {
					if (data[num1] > data2[num2]) { //标准值大于 用户输入值
						num = data[num1]
					} else {
						num = data2[num2]
					}

				}
				return num
			},
			defs(valueData) {
				let allData = this.defsResult7
				let maxJson = this.standardList ? JSON.parse(this.standardList[0].maxJson) : {
						min: 0,
						max: 0
					}, //用户添加最小值 最大值
					normalData = this.normalData ? this.normalData[this.ltabindex] : {
						min: 0,
						max: 0
					}; //用户标准值
				if (this.itemCode == 'FOUR_ITEMS_BLOOD_LIPID') { //血脂四项 血糖 标准值替换 最大值最小值
					normalData = this.surfaceData[this.itemCode][this.ltabindex]
				} else if (this.itemCode != 'BLOOD_SUGAR') {
					if (this.surfaceData[this.itemCode]) { //用户 最大值
						normalData = this.surfaceData[this.itemCode]
					}
				}
				if (this.itemCode == 'BLOOD_PRESSURE') { //血压
					maxJson.min = this.maxMin(maxJson, maxJson, 'sysMin', 'diaMin', true)
					maxJson.max = this.maxMin(maxJson, maxJson, 'sysMax', 'diaMax', false)
				} else if (this.itemCode == 'SLEEP') { //睡眠
					maxJson.min = this.$basejs.formatMinutesHour(maxJson.min)
					maxJson.max = this.$basejs.formatMinutesHour(maxJson.max)
				} else if (this.itemCode == 'BLOOD_SUGAR') { //血糖
					if (this.ltabindex == 0) { //空腹餐前
						maxJson.min = maxJson.beforesMin;
						maxJson.max = maxJson.beforesMax;
					} else if (this.ltabindex == 1) { //餐后
						maxJson.min = maxJson.aftersMin;
						maxJson.max = maxJson.aftersMax;
					} else if (this.ltabindex == 2) { //凌晨
						maxJson.min = maxJson.dawnsMin;
						maxJson.max = maxJson.dawnsMax;
					}
				}
				if (this.itemCode != 'HEART_RATE' && this.itemCode != 'BLOOD_PRESSURE') { //不等于 心率 血压
					valueData.min = this.maxMin(maxJson, normalData, 'min', 'min', true) //最小数
					valueData.max = this.maxMin(maxJson, normalData, 'max', 'max', false) //最大数
				}

				if (this.itemCode == 'SLEEP' || this.itemCode == 'GLYCOSYLATED_HEMOGLOBIN' || this.itemCode ==
					'URIC_ACID' || this.itemCode == 'BLOOD_SUGAR') { //睡眠 尿酸 糖化血红蛋白 最小值为0
					valueData.min = 0
				}
				// this.itemCode =='HOMOCYSTEINE'||
				if (this.itemCode == 'SLEEP') { //同型半胱氨酸 睡眠
					delete valueData.max
				}
				if (this.itemCode == 'BLOOD_PRESSURE') { //血压 自适应
					delete valueData.min
				}
				if (this.itemCode == 'DIET' || this.itemCode == 'MOTION' || this.itemCode == 'WEIGHT' || this.itemCode ==
					'WAIST' || this.itemCode == 'HIPLINE') { //饮食 运动 体重 腰围 臀围
					delete valueData.min
					delete valueData.max
				}
				// delete valueData.min
				// delete valueData.max
				console.log(valueData, 1071)

				let dayTime = new Date(); //获取当前标准时间
				let todayTimeTamp = dayTime.getTime(); // 转为时间戳
				let lw = new Date(dayTime - 1000 * 60 * 60 * 24 * 100); //最后一个数字30可改，30天的意思
				let minLength,
					maxLength;
				if (allData.length > 30) { //数据大于三十 按照30一页
					minLength = allData.length - 30;
					maxLength = allData.length - 1
				} else if (allData.length > 7) { //数据大于7 按照7一页
					minLength = allData.length - 7;
					maxLength = allData.length - 1
				} else { //小于7自适应
					minLength = 0;
					maxLength = allData.length;
				}
				let data = {
					value: valueData,
					recordTime: {
						type: 'timeCat',
						range: [0, 1],
						tickCount: 5
					},
					day: {
						range: [0, 1],
						tickCount: 5,
						min: minLength, //前100天
						max: maxLength, //当前时间
						formatter: function formatter(ivalue) {
							// console.log(ivalue,1136)
							if (ivalue % 1 === 0) {
								var f = allData[ivalue] ? new Date(allData[ivalue].recordNum * 1) : false;
								if (f) {
									var year = f.getFullYear();
									var month = f.getMonth() + 1;
									var date = f.getDate();
									return month + '.' + date;
								}
								// return allData[ivalue].recordTime
							}

						}
					},

				}
				console.log(data, 974)
				return data
			},
			//测量指标范围列表
			getRangeIndicator() {
				this.$api.get(global.apiUrls.getRangeIndicator, {})
					.then(res => {
						let surfaceData = {};
						let result = res.data.result;
						for (let i = 0; i < result.length; i++) {
							result[i].valueExpression.max = result[i].valueExpression.max * 1
							result[i].valueExpression.min = result[i].valueExpression.min * 1
							surfaceData[result[i].itemCode] = result[i].valueExpression
						}
						this.surfaceData = surfaceData
						console.log(surfaceData, result, 9799999)
					})
			},
			tapf2(index) {
				this.ltabindex = index
				let key = this.tablist[index].key,
					name = this.tablist[index].name,
					_this = this;
				let resultList = this.resultList,
					cdata = [];
				// console.log(resultList[0][key], name, 981111111)
				resultList = this.unique(resultList)
				resultList = JSON.parse(JSON.stringify(resultList.reverse())) || [] //颠倒排序
				// console.log(resultList)
				if (this.itemCode == 'WEIGHT') { //体重切换
					if (!this.hisUserId) { //不等于家人
						this.AddArr[this.swiperIndex].indicName = name
						this.AddArr[_this.swiperIndex].unit = index == 1 ? '%' : 'kg'
					}
					console.log(resultList[resultList.length - 1][key], 1126)
					this.price1 = resultList[resultList.length - 1][key] || ''
					for (let i = 0; i < resultList.length; i++) {
						cdata.unshift({
							day: i,
							type: name, //文本标题
							value: resultList[i][key] || 0,
							recordNum: resultList[i].recordNum,
							recordTime: resultList[i].recordTime
						})
					}
					setTimeout(() => {
						let unit = index == 1 ? '%' : 'kg';
						let valueData = {
							tickCount: 5,
							formatter: function formatter(ivalue) {
								return ivalue + unit
							}
						}
						// valueData.min = 0
						// _this.$refs.chart.changeData(cdata) //更新图表
						_this.$refs.chart.reset(chart => {
							chart.clear() // 清理所有
							chart.source(cdata,
								_this.defs(valueData)
								// {
								// 	value: valueData,
								// 	day: {
								// 		range: [0, 1]
								// 	}
								// },
							);
							chart.tooltip({
								showCrosshairs: true,
								showItemMarker: true,
								onShow: function onShow(ev) {
									console.log(ev)
									const items = ev.items;
									items[0].name = null;
									items[0].value = items[0].origin.recordTime + '：' + items[
											0].origin
										.type + ' ' + items[0].value;
								}
							});
							chart.axis('day', {
								label: function label(text, index, total) {
									const textCfg = {};
									if (index === 0) {
										textCfg.textAlign = 'left';
									} else if (index === total - 1) {
										textCfg.textAlign = 'right';
									}
									return textCfg;
								}
							});
							chart.line().position('day*value').color('type', ['#17DBFF',
									'#0ED000'
								])
								.shape('smooth');
							chart.point().position('day*value')
								.color('type', ['#17DBFF', '#0ED000'])
								.shape('smooth').style({
									stroke: '#fff',
									lineWidth: 1
								});

							chart.guide().rect({
								start: ['min', this.normalData ? this.normalData[index].min : ''],
								end: ['max', this.normalData ? this.normalData[index].max : ''],
								style: {
									fill: '#000',
									fillOpacity: 0.05
								}
							});

							chart.interaction('pan');
							// 定义进度条
							chart.scrollBar({
								mode: 'x',
								xStyle: {
									offsetY: -5
								}
							});

							chart.render();
							return chart;
						});
					}, 900)

				} else if (this.itemCode == 'FOUR_ITEMS_BLOOD_LIPID') { //血脂四项切换
					this.loadData(this.allList, 0, this.today)
				} else if (this.itemCode == 'BLOOD_SUGAR') { //血糖
					// this.BLOODVALUE = name;
					for (let i = 0; i < resultList.length; i++) {
						let userSugarVOS = resultList[i].userSugarVOS;
						for (let j = 0; j < userSugarVOS.length; j++) {
							console.log(userSugarVOS[j])
							if (index == 0) {
								if (userSugarVOS[j].timeSlot == 1) { //餐前
									cdata.unshift({
										type: '空腹/早餐前',
										day: i,
										value: userSugarVOS[j].sugarValue,
										recordNum: resultList[i].recordNum,
										recordTime: resultList[i].recordTime
									})
								} else if (userSugarVOS[j].timeSlot == 3) { //餐前
									cdata.unshift({
										type: '午餐前',
										day: i,
										value: userSugarVOS[j].sugarValue,
										recordNum: resultList[i].recordNum,
										recordTime: resultList[i].recordTime
									})
								} else if (userSugarVOS[j].timeSlot == 5) { //餐前
									cdata.unshift({
										type: '晚餐前',
										day: i,
										value: userSugarVOS[j].sugarValue,
										recordNum: resultList[i].recordNum,
										recordTime: resultList[i].recordTime
									})
								}
							} else if (index == 1) {
								if (userSugarVOS[j].timeSlot == 2) { //餐后
									cdata.unshift({
										type: '早餐后',
										day: i,
										value: userSugarVOS[j].sugarValue,
										recordNum: resultList[i].recordNum,
										recordTime: resultList[i].recordTime
									})
								} else if (userSugarVOS[j].timeSlot == 4) { //餐后
									cdata.unshift({
										type: '午餐后',
										day: i,
										value: userSugarVOS[j].sugarValue,
										recordNum: resultList[i].recordNum,
										recordTime: resultList[i].recordTime
									})
								} else if (userSugarVOS[j].timeSlot == 6) { //餐后
									cdata.unshift({
										type: '晚餐后',
										day: i,
										value: userSugarVOS[j].sugarValue,
										recordNum: resultList[i].recordNum,
										recordTime: resultList[i].recordTime
									})
								}
							} else if (index == 2) {
								if (userSugarVOS[j].timeSlot == 7) { //凌晨
									cdata.unshift({
										type: '凌晨',
										day: i,
										value: userSugarVOS[j].sugarValue,
										recordNum: resultList[i].recordNum,
										recordTime: resultList[i].recordTime
									})
								}
							}




						}
					}
					console.log(cdata, 11277777777)
					this.price1 = cdata[0] ? cdata[0].value : ''
					let colorArr = []
					if (index == 0) {
						colorArr = [
							'#2EA7E0',
							'#F5A623',
							'#0ED000',
						]
					} else if (index == 1) {
						colorArr = [
							'#6AE5C4',
							'#B8E986',
							'#F56767',
						]
					} else if (index == 2) {
						colorArr = [
							'#F56767'
						]
					}
					setTimeout(() => {
						let valueData = {
							tickCount: 5,
							formatter: function formatter(ivalue) {
								return ivalue + _this.AddArr[_this.swiperIndex].unit;
							}
						}
						// if (this.surfaceData[this.itemCode]) { //最小显示值 最大显示值
						// 	valueData.min = this.surfaceData[this.itemCode].min
						// 	valueData.max = this.surfaceData[this.itemCode].max
						// }
						_this.$refs.chart.reset(chart => {
							chart.clear() // 清理所有
							chart.source(cdata,
								_this.defs(valueData)
							);
							chart.tooltip({
								showCrosshairs: true,
								showItemMarker: true,
								onShow: function onShow(ev) {
									console.log(ev)
									const items = ev.items;
									items[0].name = null;
									let YMD = _this.$basejs.dataType(items[0].origin
										.recordNum * 1)
									items[0].name = null;
									items[0].value = YMD.n + '-' + YMD.y + '-' + YMD.r + '：' +
										items[0].origin
										.type + ' ' + items[0].value;
								}
							});
							chart.axis('day', {
								label: function label(text, index,
									total) {
									const textCfg = {};
									if (index === 0) {
										textCfg.textAlign = 'left';
									} else if (index === total -
										1) {
										textCfg.textAlign =
											'right';
									}
									return textCfg;
								}
							});
							chart.line().position('day*value').color('type', colorArr)
								.shape('smooth');
							chart.point().position('day*value')
								.color('type', colorArr)
								.shape('smooth').style({
									stroke: '#fff',
									lineWidth: 1
								});
							chart.guide().rect({
								start: ['min', this.normalData ? this.normalData[index].min : ''],
								end: ['max', this.normalData ? this.normalData[index].max : ''],
								style: {
									fill: '#000',
									fillOpacity: 0.05
								}
							});

							chart.interaction('pan');
							// 定义进度条
							chart.scrollBar({
								mode: 'x',
								xStyle: {
									offsetY: -5
								}
							});

							chart.render();
							return chart;
						});
					}, 1500)
				}

			},
			rotateTap(item, index) {
				this.resultList.forEach((e, idx) => {
					if (index == idx) {} else {
						e.rotate = false
					}
				})
				let list = this.resultList[index]
				list.rotate = !list.rotate
				this.$set(this.resultList, index, list)
				// console.log(item, index)
			},
			//删除运动
			delSportRecord(id) {
				let _this = this;
				this.$api.delete(global.apiUrls.delSportRecord + '/' + id, {})
					.then(res => {
						if (res.data.code == 1000) {
							_this.record(_this.itemCode, 200)
						} else { //错误回调
						}
					})
			},
			// 修改运动
			updateSportRecord(userSportId, heatQuantity, sportTimeLen) {
				let _this = this;
				let fdata = {
					heatQuantity: heatQuantity, //热量
					sportTimeLen: sportTimeLen, //时长
					userSportId: userSportId, //运动id
					userId: uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z').userId, //当前id
				}
				this.$api.put(global.apiUrls.updateSportRecord, fdata)
					.then(res => {
						if (res.data.code == 1000) {
							_this.record(_this.itemCode, 200)
						} else { //错误回调
						}
					})
			},
			delFoodRecord(id) { //删除食物
				let _this = this;
				this.$api.delete(global.apiUrls.delFoodRecord + '/' + id, {})
					.then(res => {
						if (res.data.code == 1000) {
							_this.record(_this.itemCode, 200)
						} else { //错误回调
						}
					})
			},
			// 修改食物
			updateFoodRecord(userFoodId, heatQuantity, intakeWeight) {
				let _this = this;
				let fdata = {
					heatQuantity: heatQuantity, //热量
					intakeWeight: intakeWeight, //克数
					userFoodId: userFoodId, //食物id
					userId: uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z').userId, //当前id
				}
				this.$api.put(global.apiUrls.updateFoodRecord, fdata)
					.then(res => {
						if (res.data.code == 1000) {
							_this.record(_this.itemCode, 200)
						} else { //错误回调
						}
					})
			},
			// 修改食物
			formFood(e) {
				console.log(e, 789)
				if (e.type == 'ys') { //饮食修改
					this.updateFoodRecord(e.foodId, e.foodHeat, e.intakeWeight)
				} else if (e.type == 'delete-ys') { //食物删除
					this.delFoodRecord(e.foodId)
				} else if (e.type == 'yd') { //运动修改
					this.updateSportRecord(e.dataSportId, e.consume, e.sliderValue)
				} else if (e.type == 'delete-yd') { //运动删除
					this.delSportRecord(e.dataSportId)
				}
			},
			// 选中日期
			handleConfirmys(e) {
				let itemCode = this.itemCode;
				if (itemCode == 'DIET') { //饮食
					this.$refs['ydk'].ydShow()
				} else if (itemCode == 'MOTION') { //运动
					this.$refs['ydklist'].ydShow()
				}
			},
			// 切换时间
			switchTime(e) {
				if (e) {
					this.$refs['picker1'].show()
					this.$refs['ydk'].hide()
				} else {
					this.$refs['ydk'].ydShow()
				}

			},
			// 修改饮食 运动
			addtap(name, item) {
				console.log(name, item)
				if (name == 'ydk') {
					item.imageLocalPath = item.foodUrl; //食物头像
					item.food = item.foodName; //食物名字
					item.scrollLeftNow = item.intakeWeight; //食物克数
					item.foodHeat = item.heatQuantity; //食物热量
					item.id = item.userFoodId; //食物id
				} else { //运动
					this.sliderValue = 0 //时长
					item.sportImageUrl = item.sportUrl; //图片
					item.dataSportName = item.sportName; //运动名
					item.minHeatQuantity = this.getnum(item.heatQuantity / item.sportTimeLen2); //消耗热量
					item.dataSportId = item.userSportId; //运动id
				}
				// item.frigorie = parseInt(item.intakeWeight*item.heatQuantity);
				this.checkedData = item;
				this.$refs[name].ydShow()
			},
			getnum(num) {
				return Math.round(num * 100) / 100
			},
			remindTx(memberId, remindType, serviceId) {
				let fdata = {
					memberId: memberId, //被提醒id
					adviserId: uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z').userId, //自己id
					remindType: remindType, //2健康数据  3健康计划
					serviceId: serviceId, //指标id
				}
				let _this = this;
				this.$api.post(global.apiUrls.remindTx, fdata)
					.then(res => {
						if (res.data.code == 1000) { //提醒完成
							_this.familyInfo()
						}
					}).catch(err => {})
			},
			// 提醒亲友
			remind(item) {
				this.remindTx(this.hisUserId, 4, 2) //用户id  类型  健康报告id
			},
			// 获取家人数据
			familyInfo() {
				let _this = this;
				this.$api.get(global.apiUrls.familyInfo + '?userId=' + uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z').userId +
						'&familyId=' + this.hisUserId, {})
					.then(res => {
						if (res.data.code == 1000) {
							// res.data.result.diseaseName = []
							_this.qyuserdata = res.data.result
						} else { //错误回调

						}
					})
			},
			// 加载数据
			loadData(data, index, today) { //全部数据  index  转换完成的日期
				console.log(data, index, today, '917777777777')
				let _this = this;
				let itemCode = this.itemCode,
					typeText = '',
					value = ''; //区分分类
				let cdata = [], //图标最大值
					maxlength = data.length, //最大长度
					result7,
					result7Data;
				let isUid = this.hisUserId ? this.hisUserId : uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z').userId
				// + '?userId=' + isUid + '&deviceType=' + itemCode + '&endTime=' + today + '&num=200'
				let sendData = {
					userId: isUid,
					deviceType: itemCode,
					endTime: today,
					num: 200,
				}
				if (itemCode == 'FOUR_ITEMS_BLOOD_LIPID') {
					sendData.childDeviceType = this.childDeviceType[this.ltabindex]
				}

				console.log(this.ltabindex, 15033333)
				this.$api.get(global.apiUrls.getListByNum, sendData)
					.then(res => {
						if (res.data.code == 1000) {
							this.tablist = []
							result7 = res.data.result;
							result7Data = result7;

							// if (itemCode != 'FOUR_ITEMS_BLOOD_LIPID') {//血脂四项去重
							result7 = this.unique(result7)
							this.standardList = result7Data
							// }
							if (itemCode == 'SLEEP') { //七天数据

								// 单数组循环赋值一个bug
								for (let i = 0; i < result7Data.length; i++) {
									result7Data[i].sleepTimeLen2 = _this.$basejs.formatMinutes(result7Data[i]
										.sleepTimeLen)
								}
								for (let i = 0; i < result7.length; i++) {
									result7[i].sleepTimeLen = _this.$basejs.formatMinutesHour(result7[i]
										.sleepTimeLen)
								}
							}
							if (itemCode != 'BLOOD_PRESSURE' && itemCode != 'BLOOD_SUGAR') { //不等于血压&&不等于血糖
								// 切换效果
								if (itemCode == 'WEIGHT') {
									this.tablist = this.tablistArr[1]
								} else if (itemCode == 'FOUR_ITEMS_BLOOD_LIPID') {
									this.tablist = this.tablistArr[0]
								}
								// end
								result7 = JSON.parse(JSON.stringify(result7.reverse()))
								_this.defsResult7 = result7
								for (let i = 0; i < result7.length; i++) {
									if (itemCode == 'DIET') { //饮食
										typeText = '饮食'
										value = result7[i].heatQuantity
									} else if (itemCode == 'MOTION') { //运动
										typeText = '运动'
										value = result7[i].heatQuantity
									} else if (itemCode == 'HEART_RATE') {
										typeText = '心率'
										value = result7[i].heartRateValue
									} else if (itemCode == 'WEIGHT') {
										typeText = '体重'
										value = result7[i].weight
										result7[i].rotate = false;
									} else if (itemCode == 'SLEEP') {
										typeText = '睡眠'
										value = result7[i].sleepTimeLen
									} else if (itemCode == 'BLOOD_OXYGEN') {
										typeText = '血氧'
										value = result7[i].value
									} else if (itemCode == 'GLYCOSYLATED_HEMOGLOBIN') {
										typeText = '糖化血红蛋白'
										value = result7[i].value
									} else if (itemCode == 'URIC_ACID') {
										typeText = '尿酸'
										value = result7[i].value
									} else if (itemCode == 'HOMOCYSTEINE') {
										typeText = '同型半胱氨酸'
										value = result7[i].value
									} else if (itemCode == 'HIPLINE') {
										typeText = '臀围'
										value = result7[i].value
									} else if (itemCode == 'WAIST') {
										typeText = '腰围'
										value = result7[i].value
									} else if (itemCode == 'FOUR_ITEMS_BLOOD_LIPID') {
										if (this.ltabindex == 0) {
											typeText = '甘油三酯'
										} else if (this.ltabindex == 1) {
											typeText = '高密度脂蛋白'
										} else if (this.ltabindex == 2) {
											typeText = '低密度脂蛋白'
										} else if (this.ltabindex == 3) {
											typeText = '总胆固醇'
										}
										value = result7[i].value
									}
									if (itemCode == 'DIET' || itemCode == 'MOTION') {
										cdata.unshift({
											day: i,
											type: typeText, //文本标题
											value: value,
											recordNum: result7[i].recordNum,
											recordTime: result7[i].recordTime
										})
									} else {
										cdata.unshift({
											day: i,
											type: typeText, //文本标题
											value: value,
											recordNum: result7[i].recordNum,
											recordTime: result7[i].recordTime
										})
									}

								}
								setTimeout(() => {
									// _this.$refs.chart.changeData(cdata) //更新图表
									let valueData = {
										tickCount: 5,
										formatter: function formatter(ivalue) {
											return ivalue + _this.AddArr[_this.swiperIndex].unit;
										}
									}
									console.log(this.surfaceData[this.itemCode], 1490000000)
									if (this.itemCode == 'FOUR_ITEMS_BLOOD_LIPID') {
										if (this.surfaceData[this.itemCode]) { //最小显示值 最大显示值
											valueData.min = this.surfaceData[this.itemCode][this.ltabindex].min
											valueData.max = this.surfaceData[this.itemCode][this.ltabindex].max
										}
									} else if (this.surfaceData[this.itemCode]) { //最小显示值 最大显示值
										if (itemCode != 'WEIGHT') { //体重自适应
											valueData.min = this.surfaceData[this.itemCode].min
											valueData.max = this.surfaceData[this.itemCode].max
										}
									}
									_this.$refs.chart.reset(chart => {
										chart.clear() // 清理所有
										chart.source(cdata,
											_this.defs(valueData)
										);
										chart.tooltip({
											showCrosshairs: true,
											showItemMarker: true,
											onShow: function onShow(ev) {
												console.log(ev)
												const items = ev.items;
												items[0].name = null;
												items[0].value = items[0].origin
													.recordTime + '：' +
													items[0].origin.type + ' ' + items[0]
													.value;
											}
										});
										chart.axis('day', {
											label: function label(text, index,
												total) {
												const textCfg = {};
												if (index === 0) {
													textCfg.textAlign = 'left';
												} else if (index === total -
													1) {
													textCfg.textAlign =
														'right';
												}
												return textCfg;
											}
										});
										chart.line().position('day*value').color('type', [
												'#17DBFF',
												'#0ED000'
											])
											.shape('smooth');

										chart.guide().rect({
											start: ['min', this.normalData ? this.itemCode ==
												'FOUR_ITEMS_BLOOD_LIPID' || this
												.itemCode == 'BLOOD_SUGAR' ? this
												.normalData[this.ltabindex]
												.min : this.normalData[0].min : ''
											],
											end: ['max', this.normalData ? this.itemCode ==
												'FOUR_ITEMS_BLOOD_LIPID' || this
												.itemCode == 'BLOOD_SUGAR' ? this
												.normalData[this.ltabindex]
												.max : this.normalData[0].max : ''
											],
											style: {
												fill: '#000',
												fillOpacity: 0.05
											}
										});
										chart.point().position('day*value')
											.color('type', ['#17DBFF', '#0ED000'])
											.shape('smooth').style({
												stroke: '#fff',
												lineWidth: 1
											});

										chart.interaction('pan');
										// 定义进度条
										chart.scrollBar({
											mode: 'x',
											xStyle: {
												offsetY: -5
											}
										});

										chart.render();
										return chart;
									});
								}, 1000)
							} else if (itemCode == 'BLOOD_PRESSURE') { //血压
								let cdata = [], //收缩压
									cdata2 = []; //舒张压
								// console.log(result7,1785555555)
								result7 = JSON.parse(JSON.stringify(result7.reverse()))
								_this.defsResult7 = result7
								for (let i = 0; i < result7.length; i++) {
									// let day = _this.$basejs.dataTypeday(result7[i].recordTime).y + '-' + _this
									// 	.$basejs
									// 	.dataTypeday(result7[i].recordTime).r; //日期转格式
									cdata.unshift({
										day: i,
										type: '收缩压',
										value: result7[i].systolicPre,
										recordNum: result7[i].recordNum,
										recordTime: result7[i].recordTime
									})
									cdata2.unshift({
										day: i,
										type: '舒张压',
										value: result7[i].diastolicPre,
										recordNum: result7[i].recordNum,
										recordTime: result7[i].recordTime
									})

								}
								cdata = cdata.concat(cdata2)
								console.log(cdata, '血压', 739)
								setTimeout(() => {
									let valueData = {
										tickCount: 5,
										formatter: function formatter(ivalue) {
											return ivalue + _this.AddArr[_this.swiperIndex].unit;
										}
									}
									if (this.surfaceData[this.itemCode]) { //最小显示值 最大显示值
										valueData.min = this.surfaceData[this.itemCode].min
										valueData.max = this.surfaceData[this.itemCode].max
									}
									_this.$refs.chart.reset(chart => {
										chart.clear() // 清理所有
										console.log(_this.defs(valueData), cdata, 1769)
										chart.source(cdata,
											_this.defs(valueData)
										);
										chart.tooltip({
											showCrosshairs: true,
											showItemMarker: true,
											onShow: function onShow(ev) {
												// console.log(ev)
												// clearInterval(_this.onShowTime);
												const items = ev.items;

												items[0].name = null;
												items[1].name = null;
												items[0].value = items[0].origin
													.recordTime + '：' +
													items[0].origin.type + ' ' + items[0]
													.value;
												items[1].value = items[1].origin
													.recordTime + '：' +
													items[1].origin.type + ' ' + items[1]
													.value;
												// 		_this.onShowTime = setTimeout(e=>{
												// },1000)

											}
										});
										chart.axis('day', {
											label: function label(text, index,
												total) {
												const textCfg = {};
												if (index === 0) {
													textCfg.textAlign = 'left';
												} else if (index === total -
													1) {
													textCfg.textAlign =
														'right';
												}
												return textCfg;
											}
										});
										chart.guide().rect({
											start: ['min', this.normalData[0].min],
											end: ['max', this.normalData[0].max],
											style: {
												fill: '#000',
												fillOpacity: 0.05
											}
										});
										chart.guide().rect({
											start: ['min', this.normalData[1].min],
											end: ['max', this.normalData[1].max],
											style: {
												fill: '#000',
												fillOpacity: 0.03
											}
										});
										chart.line().position('day*value').color('type', [
												'#17DBFF',
												'#0ED000'
											])
											.shape('smooth');
										chart.point().position('day*value')
											.color('type', ['#17DBFF', '#0ED000'])
											.shape('smooth').style({
												stroke: '#fff',
												lineWidth: 1
											});


										chart.interaction('pan');
										// 定义进度条
										chart.scrollBar({
											mode: 'x',
											xStyle: {
												offsetY: -5
											}
										});


										chart.render();
										return chart;
									});
									// _this.$refs.chart.changeData(cdata)
								}, 1000)
							} else if (itemCode == 'BLOOD_SUGAR') { //血糖
								this.tablist = this.tablistArr[2] //切换
								let xyformtime = []; //日期
								result7 = JSON.parse(JSON.stringify(result7.reverse()))
								_this.defsResult7 = result7
								for (let i = 0; i < result7.length; i++) {
									let userSugarVOS = result7[i].userSugarVOS;
									let xyformtime1 = [{
												sugarValue: '--',
												indicGrade: ''
											},
											{
												sugarValue: '--',
												indicGrade: ''
											},
											{
												sugarValue: '--',
												indicGrade: ''
											},
											{
												sugarValue: '--',
												indicGrade: ''
											},
											{
												sugarValue: '--',
												indicGrade: ''
											},
											{
												sugarValue: '--',
												indicGrade: ''
											}
										], //1-6
										xyformtime6 = [{
											sugarValue: '--',
											indicGrade: ''
										}]; //周日
									// for (let b = 0; b < 6; b++) {
									// 	xyformtime1.push({
									// 		sugarValue: '--',
									// 		indicGrade: ''
									// 	})
									// }

									for (let j = 0; j < userSugarVOS.length; j++) {
										console.log(userSugarVOS[j])
										if (userSugarVOS[j].timeSlot == 1) { //餐前
											cdata.unshift({
												type: '空腹/早餐前',
												day: i,
												// day: parseInt(result7[i].recordTime.split('-')[0]) + '.' +
												// 	parseInt(result7[i].recordTime.split('-')[1]),
												value: userSugarVOS[j].sugarValue,
												recordNum: result7[i].recordNum,
												recordTime: result7[i].recordTime
											})
										}
										if (userSugarVOS[j].timeSlot == 3) { //餐前
											cdata.unshift({
												type: '午餐前',
												day: i,
												// day: parseInt(result7[i].recordTime.split('-')[0]) + '.' +
												// 	parseInt(result7[i].recordTime.split('-')[1]),
												value: userSugarVOS[j].sugarValue,
												recordNum: result7[i].recordNum,
												recordTime: result7[i].recordTime
											})
										}
										if (userSugarVOS[j].timeSlot == 5) { //餐前
											cdata.unshift({
												type: '晚餐前',
												day: i,
												// day: parseInt(result7[i].recordTime.split('-')[0]) + '.' +
												// 	parseInt(result7[i].recordTime.split('-')[1]),
												value: userSugarVOS[j].sugarValue,
												recordNum: result7[i].recordNum,
												recordTime: result7[i].recordTime
											})
										}
										if (userSugarVOS[j].timeSlot == 1) {
											xyformtime1[0] = {
												sugarValue: userSugarVOS[j].sugarValue,
												indicGrade: userSugarVOS[j].indicGrade,
												indicStatus: userSugarVOS[j].indicStatus
											}
										}
										if (userSugarVOS[j].timeSlot == 2) {
											xyformtime1[1] = {
												sugarValue: userSugarVOS[j].sugarValue,
												indicGrade: userSugarVOS[j].indicGrade,
												indicStatus: userSugarVOS[j].indicStatus
											}
										}
										if (userSugarVOS[j].timeSlot == 3) {
											xyformtime1[2] = {
												sugarValue: userSugarVOS[j].sugarValue,
												indicGrade: userSugarVOS[j].indicGrade,
												indicStatus: userSugarVOS[j].indicStatus
											}
										}
										if (userSugarVOS[j].timeSlot == 4) {
											xyformtime1[3] = {
												sugarValue: userSugarVOS[j].sugarValue,
												indicGrade: userSugarVOS[j].indicGrade,
												indicStatus: userSugarVOS[j].indicStatus
											}
										}
										if (userSugarVOS[j].timeSlot == 5) {
											xyformtime1[4] = {
												sugarValue: userSugarVOS[j].sugarValue,
												indicGrade: userSugarVOS[j].indicGrade,
												indicStatus: userSugarVOS[j].indicStatus
											}
										}
										if (userSugarVOS[j].timeSlot == 6) {
											xyformtime1[5] = {
												sugarValue: userSugarVOS[j].sugarValue,
												indicGrade: userSugarVOS[j].indicGrade,
												indicStatus: userSugarVOS[j].indicStatus
											}
										}
										if (userSugarVOS[j].timeSlot == 7) {
											xyformtime6[0] = {
												sugarValue: userSugarVOS[j].sugarValue,
												indicGrade: userSugarVOS[j].indicGrade,
												indicStatus: userSugarVOS[j].indicStatus
											}
										}
									}
									xyformtime.push({
										recordTime: result7[i].recordTime,
										xyformtime1: xyformtime1,
										xyformtime6: xyformtime6
									}) //添加时间
									console.log(result7[i], 1432222222222)
								}
								let xyformtimea, //三餐
									xyformtimeb; //凌晨
								let xzday = _this.$basejs.dataTypeday(today).y + '-' + _this.$basejs
									.dataTypeday(today)
									.r;
								for (let i = 0; i < xyformtime.length; i++) {
									// console.log(xyformtime[0].recordTime,xzday,1158)
									if (xyformtime[i].recordTime == xzday) { //选中日期
										xyformtimea = xyformtime[i].xyformtime1, //三餐
											xyformtimeb = xyformtime[i].xyformtime6; //凌晨
										break;
									} else { //拿最后一位
										xyformtimea = xyformtime[xyformtime.length - 1].xyformtime1, //三餐
											xyformtimeb = xyformtime[xyformtime.length - 1]
											.xyformtime6; //凌晨
									}
								}

								console.log(cdata, 1492222)
								setTimeout(() => {
									_this.$refs.chart.reset(chart => {
										chart.clear() // 清理所有
										let valueData = {
											tickCount: 5,
											formatter: function formatter(ivalue) {
												return ivalue + _this.AddArr[_this.swiperIndex]
													.unit;
											}
										}
										if (this.surfaceData[this.itemCode]) { //最小显示值 最大显示值
											valueData.min = this.surfaceData[this.itemCode].min
											if (this.surfaceData[this.itemCode].max) {
												valueData.max = this.surfaceData[this.itemCode].max
											}
										}
										chart.source(cdata,
											_this.defs(valueData)
											// {
											// 	value: valueData,
											// 	day: {
											// 		range: [0, 1]
											// 	}
											// },
										);
										chart.tooltip({
											showCrosshairs: true,
											showItemMarker: true,
											onShow: function onShow(ev) {
												console.log(ev)
												const items = ev.items;
												items[0].name = null;
												let YMD = _this.$basejs.dataType(items[0]
													.origin.recordNum * 1)
												items[0].name = null;
												items[0].value = YMD.n + '-' + YMD.y +
													'-' + YMD.r + '：' + items[0].origin
													.type + ' ' + items[0].value;
											}
										});
										chart.axis('day', {
											label: function label(text, index,
												total) {
												const textCfg = {};
												if (index === 0) {
													textCfg.textAlign = 'left';
												} else if (index === total -
													1) {
													textCfg.textAlign =
														'right';
												}
												return textCfg;
											}
										});
										chart.line().position('day*value').color('type', [
												'#2EA7E0',
												'#F5A623',
												'#0ED000',
											])
											.shape('smooth');
										chart.point().position('day*value')
											.color('type', [
												'#2EA7E0',
												'#F5A623',
												'#0ED000',
											])
											.shape('smooth').style({
												stroke: '#fff',
												lineWidth: 1
											});


										chart.guide().rect({
											start: ['min', this.normalData[0].min],
											end: ['max', this.normalData[0].max],
											style: {
												fill: '#000',
												fillOpacity: 0.05
											}
										});
										chart.render();
										return chart;
									});
								}, 1500)
								_this.xyformtime = xyformtime;

							}
							if (itemCode == 'DIET' || itemCode == 'MOTION') {
								// result7 = result7.reverse()
							}
							console.log(result7Data, 17900000000)
							if (itemCode == 'FOUR_ITEMS_BLOOD_LIPID') { //血脂四项value
								if (!this.hisUserId) { //不等于家人
									this.AddArr[this.swiperIndex].indicName = this.tablist[this.ltabindex].name
								}
								this.price1 = result7Data[0] ? result7Data[0].value : ''
							}
							_this.resultList = result7Data || [] //七日数据
						}
					})

			},
			//删除数组保留一个
			unique(tmp) {
				let arr = JSON.parse(JSON.stringify(tmp));
				for (var i = 0; i < arr.length; i++) {
					for (var j = i + 1; j < arr.length; j++) {
						if (arr[i].recordTime == arr[j].recordTime) {
							arr.splice(j, 1);
							j--;
						}
					}
				}
				console.log(arr, '数据是个啥！！！！！')
				return arr;
			},
			userIndicators() { //获取用户指标
				this.loadingone = true;
				let _this = this;
				this.$api.get(global.apiUrls.userIndicators + '?userId=' + uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z')
						.userId +
						'&hisUserId=' + this.hisUserId, {})
					.then(res => {
						if (res.data.code == 1000) {
							let AddArr = [], //默认选中
								AddArrc = [], //选中arr
								noAddarr = [] //未选中
							let userArr = res.data.result,
								swiperIndex = 0;
							for (let i = 0; i < userArr.length; i++) {
								userArr[i].name = userArr[i].indicName
								if (userArr[i].defaultFlag == 1) {
									AddArr.push(userArr[i])
								} else if (userArr[i].chooseFlag == 1) {
									AddArrc.push(userArr[i])
								} else {
									noAddarr.push(userArr[i])
								}
							}
							let resultArr = AddArr.concat(AddArrc);
							for (let i = 0; i < resultArr.length; i++) {
								if (_this.indicId == resultArr[i].indicId) {
									swiperIndex = i
								}
							}
							// _this.swiperIndex = swiperIndex
							_this.AddArr = resultArr
							_this.noAddarr = noAddarr;
							console.log(swiperIndex, '1299999999999999swiperIndex')
							_this.swiperChange({
								detail: {
									current: swiperIndex
								}
							})
						} else { //错误回调

						}
						_this.loadingone = false;
					})
			},
			// 获取最近一次记录
			record(itemCode, num) {
				let _this = this;
				this.itemCode = itemCode;
				// 切换其他tab ltabindex =0
				if (itemCode == 'FOUR_ITEMS_BLOOD_LIPID' || itemCode == 'BLOOD_SUGAR' || itemCode ==
					'WEIGHT') {
					if (itemCode == 'WEIGHT') {
						this.AddArr[this.swiperIndex].indicName = '体重'
					} else if (itemCode == 'BLOOD_SUGAR') {
						this.AddArr[this.swiperIndex].indicName = '血糖'
					} else if (itemCode == 'FOUR_ITEMS_BLOOD_LIPID') {
						this.AddArr[this.swiperIndex].indicName = '血脂四项'
					}
				} else {
					this.ltabindex = 0
				}
				this.$api.get(global.apiUrls.getIndictStandard, {
						itemCode: itemCode
					})
					.then(normalData => {
						this.normalData = normalData.data.result;
						if (itemCode == 'MOTION') { //运动
							this.$api.get(global.apiUrls.userSport + '?userId=' + uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z')
								.userId +
								'&hisUserId=' + this.hisUserId, {}).then(
								res => {
									if (res.data.code == 1000) { //一天数据
										let result = res.data.result;
										let userSportVOS = result ? result.userSportVOS : [];
										for (let i = 0; i < userSportVOS.length; i++) {
											userSportVOS[i].sportTimeLen2 = userSportVOS[i].sportTimeLen; //保留运动时间
											userSportVOS[i].sportTimeLen = _this.$basejs.formatMinutes(
												userSportVOS[i]
												.sportTimeLen)
										}
										_this.price1 = result ? result.heatQuantity : '';
										_this.dietArr = result ? result.userSportVOS : []
										// _this.oneResult = result;
									}
								})
							this.$api.get(global.apiUrls.getListYd + '?userId=' + uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z')
								.userId +
								'&num=' + num + '&hisUserId=' + this.hisUserId, {}).then(res => {
								console.log(res)
								if (res.data.code == 1000) { //七天数据
									let result = res.data.result;
									result = this.unique(result)
									_this.resultListlength = result.length;
									if (result == null || result.length == 0) {
										result = null
										_this.resultList = result || []
									} else {
										_this.today = result[result.length - 1].recordTime
										_this.loadData(result, result.length - 1, _this.today)
										_this.allList = result.reverse(); //全部的数据
									}
								}
							})
						} else if (itemCode == 'DIET') { //饮食
							this.$api.get(global.apiUrls.userFood + '?userId=' + uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z')
								.userId +
								'&hisUserId=' + this.hisUserId, {}).then(
								res => {
									if (res.data.code == 1000) { //一天数据
										let result = res.data.result;
										_this.price1 = result ? result.heatQuantity : '';
										_this.dietArr = result ? result.userFoodVOS : [];
									}
								})
							this.$api.get(global.apiUrls.getListYs + '?userId=' + uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z')
								.userId +
								'&num=' + num + '&hisUserId=' + this.hisUserId, {}).then(res => {
								console.log(res)
								if (res.data.code == 1000) { //七天数据
									let result = res.data.result;
									result = this.unique(result)
									_this.resultListlength = result.length;
									if (result == null || result.length == 0) {
										result = null
										_this.resultList = result || []
									} else {
										_this.today = result[result.length - 1].recordTime
										_this.loadData(result, result.length - 1, _this.today)
										_this.allList = result.reverse(); //全部的数据
									}

								}
							})
						} else { //其他统一
							this.$api.get(global.apiUrls.getLastTimeG + '?userId=' + uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z')
									.userId +
									'&hisUserId=' + this.hisUserId + '&deviceType=' + itemCode, {})
								.then(res => {
									if (res.data.code == 1000) { //一天数据
										let result = res.data.result ? res.data.result : '';
										if (itemCode == 'FOUR_ITEMS_BLOOD_LIPID') { //血脂四项
											_this.price1 = result ? result.triglyceride || result.topLipoprotein ||
												result
												.lowLipoprotein || result.cholesterol : ''
										} else if (itemCode == 'WEIGHT') { //体重
											console.log(result, 1260)
											if (_this.ltabindex == 0) {
												_this.price1 = result ? result.weight : '';
											} else if (_this.ltabindex == 1) { //体脂率
												_this.price1 = result ? result.bodyfat : '';
											} else if (_this.ltabindex == 2) { //肌肉量
												_this.price1 = result ? result.muscleMass : '';
											}
										} else if (itemCode == 'BLOOD_SUGAR') { //血糖
											let BLOODVALUE = '刚刚';
											if (result) { //回调数据不等于空
												let timeSlot = result.timeSlot; //时段
												if (timeSlot == 1) {
													BLOODVALUE = '空腹'
												} else if (timeSlot == 2) {
													BLOODVALUE = '早餐后'
												} else if (timeSlot == 3) {
													BLOODVALUE = '午餐前'
												} else if (timeSlot == 4) {
													BLOODVALUE = '午餐后'
												} else if (timeSlot == 5) {
													BLOODVALUE = '晚餐前'
												} else if (timeSlot == 6) {
													BLOODVALUE = '晚餐后'
												} else if (timeSlot == 7) {
													BLOODVALUE = '凌晨'
												}
											}
											_this.BLOODVALUE = BLOODVALUE;
											_this.price1 = result.sugarValue ? result.sugarValue : '';
										} else if (itemCode == 'SLEEP') { //睡眠
											let houraaa = '0'
											let dayHour = _this.$basejs.formatMinutesdata(result.sleepTimeLen)
											console.log(dayHour, 1990000)
											if (dayHour.day && dayHour.hour) {
												houraaa = dayHour.day + '天' + dayHour.hour
											} else if (dayHour.hour) {
												houraaa = dayHour.hour
											}
											_this.price1 = result ? houraaa : '';
											_this.price2 = result ? dayHour.minute == 0 ? '' : dayHour.minute : '';
											let AddArr = _this.AddArr, //全部指标
												swiperIndex = _this.swiperIndex; //当前选���
											AddArr[swiperIndex].unit = '小时';
											if (dayHour.minute != 0) {
												AddArr[swiperIndex].unit1 = '分钟';
											} else {
												AddArr[swiperIndex].unit1 = '';
											}
											_this.AddArr = AddArr;
											// result.sleepTimeLen = _this.$basejs.formatMinutes(result.sleepTimeLen)
											// result.deepSleepTimeLen = _this.$basejs.formatMinutes(result.deepSleepTimeLen?result.deepSleepTimeLen:'')
											// result.lightSleepTimeLen = _this.$basejs.formatMinutes(result.lightSleepTimeLen?result.lightSleepTimeLen:'')
											_this.oneResult = result;
										} else if (itemCode == 'BLOOD_PRESSURE') { //血压
											let result = res.data.result ? res.data.result : '';
											_this.price1 = result ? result.systolicPre : '';
											_this.price2 = result ? result.diastolicPre : '';
											_this.oneResult = result;
										} else if (itemCode == 'HEART_RATE') { //心率
											_this.price1 = result ? result.heartRateValue : '';
											_this.oneResult = result ? result : '';
										} else { //其他
											_this.price1 = result ? result.value : '';
										}
										_this.oneResult = result;
									}
								})
							this.$api.get(global.apiUrls.getListByNumG + '?userId=' + uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z')
									.userId +
									'&num=' + num + '&hisUserId=' + this.hisUserId + '&deviceType=' + itemCode, {})
								.then(res => {
									console.log(res, 21999999999)
									if (res.data.code == 1000) { //七天数据
										let result = res.data.result ? res.data.result : [];
										result = this.unique(result)
										_this.resultListlength = result.length;
										_this.dayValue = result.length;
										if (itemCode == 'SLEEP') { //七天数据
											// let result = res.data.result;
											for (let i = 0; i < result.length; i++) {
												result[i].sleepTimeLen2 = this.$basejs.formatMinutes(result[i]
													.sleepTimeLen)
											}
										} else if (itemCode == 'BLOOD_SUGAR') { //血糖
											_this.allList = result; //全部的数据
										}
										_this.allList = result; //全部的数据
										if (result == null || result.length == 0) {
											result = null
											_this.resultList = result || []
										} else {
											if (_this.itemCode == 'BLOOD_SUGAR') {
												_this.today = result[0].yearRecordTime

											} else {
												_this.today = result[0].recordTime
											}
											_this.loadData(result, 0, _this.today)
										}
									}
								})
						}
					})
			},
			handleTap(name) {
				if (this.itemCode == 'BLOOD_PRESSURE' || this.itemCode ==
				'WEIGHT'||this.itemCode =='URIC_ACID'|| this.itemCode == 'BLOOD_SUGAR') { //血压 体重 血糖 尿酸
					this.list3 = ['设备录入', '手动录入']
					this.$refs[name].show()
				} else {
					let AddArr = this.AddArr, //当���添加指标
						swiperIndex = this.swiperIndex, //当前选中指标
						indicName; //当前name
					indicName = this.indicName;
					let indicId = AddArr[swiperIndex].indicId;
					console.log(indicName, 1614444)
					// this.list3 = ['手动录入']
					// if (this.ltabindex !== 0 && this.itemCode == 'WEIGHT') { //设备录入体脂率 肌肉量
					// 	// wx.openBluetoothAdapter({ //调用微信小程序api 打开蓝牙适配器接口
					// 	// 	success: function(res) {
					// 	// 		uni.navigateTo({
					// 	// 			url: '/pages/subpackage/home/equipment/balance'
					// 	// 		})
					// 	// 	},
					// 	// 	fail: function(res) { //如果手机上的蓝牙没有打开，可以提醒用户
					// 	// 		console.log(res, '1554')
					// 	// 		if (res.errCode == 10001) {
					// 	// 			wx.showToast({
					// 	// 				title: '请开启蓝牙',
					// 	// 				icon: 'none',
					// 	// 				duration: 2000
					// 	// 			})
					// 	// 		} else {
					// 	// 			wx.showToast({
					// 	// 				title: '您的微信版本不支持蓝牙连接',
					// 	// 				icon: 'none',
					// 	// 				duration: 2000
					// 	// 			})
					// 	// 		}
					// 	// 	}
					// 	// })
					// } else

					if (indicName == '血压') { //血压
						uni.navigateTo({
							url: '/pages/subpackage/home/record/bloodPressure?indicId=' + indicId
						})
					} else if (indicName == '血糖') { //血糖
						uni.navigateTo({
							url: '/pages/subpackage/home/record/blood?indicId=' + indicId
						})
					} else if (indicName == '心率') { //心率
						uni.navigateTo({
							url: '/pages/subpackage/home/record/heartRate?indicId=' + indicId
						})
					} else if (indicName == '饮食') { //饮食
						uni.navigateTo({
							url: '/pages/subpackage/home/record/diet?indicId=' + indicId
						})
					} else if (indicName == '运动') { //运动
						uni.navigateTo({
							url: '/pages/subpackage/home/record/exercise?indicId=' + indicId
						})
					} else if (indicName == '睡眠') {
						uni.navigateTo({
							url: '/pages/subpackage/home/record/sleep?indicId=' + indicId
						})
					} else if (indicName == '体重') {
						uni.navigateTo({
							url: '/pages/subpackage/home/record/weight?indicId=' + indicId
						})
					} else if (indicName == '血脂四项' || indicName == '甘油三酯') {
						uni.navigateTo({
							url: '/pages/subpackage/home/record/triglyceride?indicId=' + indicId
						})
					} else if (indicName == '血氧') {
						uni.navigateTo({
							url: '/pages/subpackage/home/record/bloodOxygen?indicId=' + indicId
						})
					} else if (indicName == '臀围') {
						uni.navigateTo({
							url: '/pages/subpackage/home/record/hipline?indicId=' + indicId
						})
					} else if (indicName == '腰围') {
						uni.navigateTo({
							url: '/pages/subpackage/home/record/theWaist?indicId=' + indicId
						})
					} else if (indicName == '同型半胱氨酸') {
						uni.navigateTo({
							url: '/pages/subpackage/home/record/homocysteine?indicId=' + indicId
						})
					} else if (indicName == '尿酸') {
						uni.navigateTo({
							url: '/pages/subpackage/home/record/uricAcid?indicId=' + indicId
						})
					} else if (indicName == '糖化血红蛋白') {
						uni.navigateTo({
							url: '/pages/subpackage/home/record/glycosylatedHemoglobin?indicId=' +
								indicId
						})
					}
				}
			},
			handleChange(e) {
				// console.log('change::', e)
			},
			// 手动选择
			handleConfirm(e) {
				let AddArr = this.AddArr, //当前添加指标
					swiperIndex = this.swiperIndex, //当前选中指标
					indicName; //当前name
				indicName = AddArr[swiperIndex].indicName;

				if (e.dataset.name == "label3") {
					let item = e.item,
						AddArr = this.AddArr, //当前指标
						swiperIndex = this.swiperIndex, //选中指标索引
						indicId;
					indicId = AddArr[swiperIndex].indicId
					if (item == "手动录入") {
						if (indicName === '血压') { //血压
							uni.navigateTo({
								url: '/pages/subpackage/home/record/bloodPressure?indicId=' + indicId
							})
						} else if (indicName === '血糖') { //血糖
							uni.navigateTo({
								url: '/pages/subpackage/home/record/blood?indicId=' + indicId
							})
						} else if (indicName === '心率') { //心率
							uni.navigateTo({
								url: '/pages/subpackage/home/record/heartRate?indicId=' + indicId
							})
						} else if (indicName === '饮食') { //饮食
							uni.navigateTo({
								url: '/pages/subpackage/home/record/diet?indicId=' + indicId
							})
						} else if (indicName === '运动') { //运动
							uni.navigateTo({
								url: '/pages/subpackage/home/record/exercise?indicId=' + indicId
							})
						} else if (indicName === '睡眠') {
							uni.navigateTo({
								url: '/pages/subpackage/home/record/sleep?indicId=' + indicId
							})
						} else if (indicName === '体重' || indicName === '体脂率' || indicName === '肌肉量') {
							uni.navigateTo({
								url: '/pages/subpackage/home/record/weight?indicId=' + indicId
							})
						} else if (indicName === '尿酸') {
							uni.navigateTo({
								url: '/pages/subpackage/home/record/uricAcid?indicId=' + indicId
							})
						}
					} else if (item == '设备录入') {
						wx.openBluetoothAdapter({ //调用微信小程序api 打开蓝牙适配器接口
							success: function(res) {
								console.log(res, '1543')
								if (indicName === '血压') { //血压
									uni.navigateTo({
										url: '/pages/subpackage/home/equipment/bloodPressure'
									})
								} else if (indicName == '体重' || indicName === '体脂率' || indicName === '肌肉量') {
									uni.navigateTo({
										url: '/pages/subpackage/home/equipment/balance'
									})
								} else if (indicName == '血糖') {
									uni.navigateTo({
										url: '/pages/subpackage/home/equipment/bloodSugar'
									})
								}else if (indicName == '尿酸') {
									uni.navigateTo({
										url: '/pages/subpackage/home/equipment/uricAcid'
									})
								}
							},
							fail: function(res) { //如果手机上的蓝牙没有打开，可以提醒用户
								console.log(res, '1554')
								if (res.errCode == 10001) {
									wx.showToast({
										title: '请开启蓝牙',
										icon: 'none',
										duration: 2000
									})
								} else {
									wx.showToast({
										title: '您的微信版本不支持蓝牙连接',
										icon: 'none',
										duration: 2000
									})
								}
							}
						})



					}

				}
			},
			handleCancel(e) {
				// console.log('cancel::', e)
			},
			deletaddview(item, idx) {
				if (idx >= 2) {
					let _this = this;
					this.$api.get(global.apiUrls.userIndicators + '/' + item.indicId + '?userId=' + uni
						.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z').userId, {}).then(res => {
						if (res.data.code == 1000) {
							_this.userIndicators()
						}
					})
				}
			},
			addh(item) {
				let fdata = {
						indicId: item.indicId,
						userId: uni.getStorageSync(global.IS_DEV?'USER_DATA_BSY_T':'USER_DATA_BSY_Z').userId
					},
					_this = this;
				this.$api.post(global.apiUrls.userIndicators, fdata).then(res => {
					_this.userIndicators()
				})
				// this.AddArr.push(item)
			},
			topBd(item, idx) {
				if (idx == 1) {
					this.popupshow = true
				} else if (idx == 0) {
					// uni.navigateTo({
					// 	url: '/pagesMy/my/equipment/equipment'
					// })
					uni.navigateTo({
						url: "plugin-private://wxe3d2a6ab8dd5b49b/pages/device/mylist/index",
					});
				}
			},
			tabsChange(index) { //新增值解决找不到索引bug
				this.currentIndex = index
				this.swiperChange({
					detail: {
						current: index
					}
				})
			},
			swiperChange(e) {
				console.log(e)
				let AddArr = this.AddArr,
					swiperIndex = e.detail.current;
				this.swiperIndex = swiperIndex;
				// this.dayValue = 100
				this.indicName = AddArr[swiperIndex].indicName
				this.itemCode = AddArr[swiperIndex].itemCode
				console.log(AddArr, this.itemCode, this.indicName, 23988888888)
				this.record(this.itemCode, 200)
			},
		}
	}
</script>
<style lang="scss">
	.noDataicon {
		width: 213upx;
		height: 209upx;
		background: url(https://bsyjk-pic.bsyjk.cn/empty/EFF804A9156249AD920DEF9CC805EFC7.png)no-repeat;
		background-size: 213upx 209upx;
		margin: 100upx auto 30upx;
	}

	.family-tab {
		width: 135upx;
		height: 200upx;
		text-align: center;
		display: inline-block;
		padding: 56upx 0 0;
		font-size: 28upx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 40upx;
	}

	.family-actave {
		position: relative;
	}

	.family-actave::before {
		content: '';
		position: absolute;
		left: 50%;
		top: 120upx;
		transform: translateX(-50%);
		width: 75upx;
		height: 11upx;
		background: #81C042;
		border-radius: 5upx;
	}

	.familybg {
		height: 409rpx;
		position: relative;
		background: url(https://static.bsyjk.cn/health-pg/2E165323C8EE47EC902A95A24679A025.png)no-repeat #fff;
		background-size: 750rpx 277rpx;
		padding-top: 20upx;
		box-sizing: border-box;
	}

	.dear-flex {
		width: 714upx;
		height: 120upx;
		margin: 0 auto;
		display: flex;

		.qyimage {
			width: 120upx;
			height: 120upx;
			border-radius: 50%;
		}

		.actavesm {
			position: relative;
		}

		.actavesm::before {
			content: '';
			position: absolute;
		}

		.user-viuew {
			width: 590upx;
			height: 120upx;
			padding: 10upx 20upx 0 10upx;

			.qinyou-name {
				font-size: 36upx;
				font-family: PingFang-SC-Heavy, PingFang-SC;
				font-weight: 800;
				color: #FFFFFF;
				line-height: 50upx;

				.userjibingn {
					width: 440upx;
					height: 50upx;
					float: right;
					overflow: hidden;

					.nammebjb {
						display: inline-block;
						min-width: 133upx;
						height: 40upx;
						background: #81C042;
						border-radius: 20upx;
						font-size: 26upx;
						text-align: center;
						margin-right: 10upx;
						font-weight: 400;
						line-height: 40upx;
						color: #fff;
					}

					.nammebjb2 {
						display: inline-block;
						min-width: 133upx;
						height: 40upx;
						border-radius: 20upx;
						font-size: 26upx;
						text-align: center;
						margin-right: 10upx;
						font-weight: 400;
						line-height: 40upx;
					}
				}
			}

			.qinyou-content {
				padding-top: 10upx;
				font-size: 24upx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 33upx;

				.nonebaogao {
					font-size: 24upx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #FFFFFF;
					line-height: 33upx;
					float: right;
				}
			}
		}
	}

	.wrap {
		padding: 80rpx 0 10upx;
	}

	.selectTime-flex {
		width: 640upx;
		margin: 0 auto;
		display: flex;
		height: 75upx;
		line-height: 75upx;
		font-size: 22upx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #485465;

		.selectTime-l,
		.selectTime-r {
			width: 50%;
		}
	}

	.colorFf3 .u-td {
		color: #FF333A !important;
	}

	.color2Ea3 .u-td {
		color: #FF333A !important;
	}

	// 饮食
	.DIET {
		background: linear-gradient(179deg, #FAD961 0%, #F76B1C 100%);
	}

	.DIETli {
		border-bottom: 1px dashed #FDB99B;
	}

	.DIETbtn {
		background: linear-gradient(270deg, #FAD961 0%, #F76B1C 100%);
	}

	// 运动
	.MOTION {
		background: linear-gradient(360deg, #26B9D1 0%, #13C2B4 100%);
	}

	.MOTIONli {
		border-bottom: 1px dashed #13C2B4;
	}

	.MOTIONbtn {
		background: linear-gradient(360deg, #26B9D1 0%, #13C2B4 100%);
	}

	// 血压
	.BLOOD_PRESSURE {
		background: linear-gradient(180deg, #5A78F0 0%, #4149EF 100%);
	}

	.BLOOD_PRESSUREli {
		border-bottom: 1px dashed #13C2B4;
	}

	.BLOOD_PRESSUREbtn {
		background: linear-gradient(90deg, #26B9D1 0%, #13C2B4 67%);
	}

	// 血糖
	.BLOOD_SUGAR,
	.BLOOD_SUGARbtn {
		background: linear-gradient(225deg, #FF8960 0%, #FF62A5 100%);
	}

	.BLOOD_SUGARli {
		border-bottom: 1px dashed #FF62A5;
	}

	// 心率
	.HEART_RATE {
		background: linear-gradient(180deg, #FDB99B 0%, #CF8BF3 50%, #A770EF 100%)
	}

	.HEART_RATEli {
		border-bottom: 1px dashed #FDB99B;
	}

	.HEART_RATEbtn {
		background: linear-gradient(90deg, #A770EF 0%, #CF8BF3 50%, #FDB99B 100%);
	}

	// 睡眠
	.SLEEP {
		background: linear-gradient(180deg, #FFA26E 0%, #E36D5D 100%);
	}

	.SLEEPli {
		border-bottom: 1px dashed #E36D5D;
	}

	.SLEEPbtn {
		background: linear-gradient(180deg, #FFA26E 0%, #E36D5D 100%);
	}

	// 体重
	.WEIGHT {
		background: linear-gradient(358deg, #524D6E 0%, #8F8AAD 100%);
	}

	.WEIGHTli {
		border-bottom: 1px dashed #8F8AAD;
	}

	.WEIGHTbtn {
		background: linear-gradient(358deg, #524D6E 0%, #8F8AAD 100%);
	}

	// // 第一组颜色
	// .background0,
	// .background4,
	// .background8 {
	// 	background: linear-gradient(180deg, #5A78F0 0%, #4149EF 100%)
	// }

	// .borcolor0,
	// .borcolor4,
	// .borcolor8 {
	// 	border-bottom: 1px dashed #13C2B4;
	// }

	// .btnbg0,
	// .btnbg4,
	// .btnbg8 {
	// 	background: linear-gradient(90deg, #26B9D1 0%, #13C2B4 67%);
	// }

	// // 第二组颜色
	// .background1,
	// .background5,
	// .background9 {
	// 	background: linear-gradient(225deg, #FF8960 0%, #FF62A5 100%)
	// }

	// .borcolor1,
	// .borcolor5,
	// .borcolor9 {
	// 	border-bottom: 1px dashed #FF62A5;
	// }

	// .btnbg1,
	// .btnbg5,
	// .btnbg9 {
	// 	background: linear-gradient(225deg, #FF8960 0%, #FF62A5 100%);
	// }

	// // 第三组颜色
	// .background2,
	// .background6,
	// .background10 {
	// 	background: linear-gradient(180deg, #FDB99B 0%, #CF8BF3 50%, #A770EF 100%)
	// }

	// .borcolor2,
	// .borcolor6,
	// .borcolor10 {
	// 	border-bottom: 1px dashed #FDB99B;
	// }

	// .btnbg2,
	// .btnbg6,
	// .btnbg10 {
	// 	background: linear-gradient(90deg, #A770EF 0%, #CF8BF3 50%, #FDB99B 100%);
	// }

	// // 第四组颜色
	// .background3,
	// .background7 {
	// 	background: linear-gradient(179deg, #FAD961 0%, #F76B1C 100%);
	// }

	// .borcolor3,
	// .borcolor7 {
	// 	border-bottom: 1px dashed #FDB99B;
	// }

	// .btnbg3,
	// .borcolor7 {
	// 	background: linear-gradient(270deg, #FAD961 0%, #F76B1C 100%);
	// }

	// // end
	.popupContent {
		width: 540upx;
		height: 753upx;
		background: #FFFFFF;
		padding: 0 48upx;
		box-sizing: border-box;
		overflow: hidden;

		.popupAddview {
			height: 600rpx;
		}

		.popupTitle {
			font-size: 38upx;
			font-weight: 400;
			color: #000000;
			line-height: 36upx;
			position: relative;
			text-align: center;
			padding: 48upx 0 42upx 0;

			.popupClickno {
				content: '';
				width: 43upx;
				height: 43upx;
				position: absolute;
				top: 17upx;
				right: -28upx;
				background: url(https://bsyjk-pic.bsyjk.cn/deleteiconc/3F2353D03E7C4CB4B8689F45B2DB9ADF.png)no-repeat;
				background-size: 43upx 43upx;
			}
		}

		.popupAdd {
			font-size: 30upx;
			font-weight: 500;
			color: #333333;
			line-height: 42upx;
			margin-bottom: 28upx;
		}

		.addView {
			min-width: 120upx;
			height: 50upx;
			display: inline-block;
			background: #F5F5F5;
			border-radius: 3upx;
			font-size: 28upx;
			font-weight: 400;
			color: #000000;
			line-height: 50upx;
			text-align: center;
			margin: 0 20upx 40upx 0;
			position: relative;
			padding: 0 30rpx;
		}

		.addView_b:before {
			content: '';
			position: absolute;
			top: -10upx;
			right: -10upx;
			width: 34upx;
			height: 34upx;
			background: url(https://bsyjk-pic.bsyjk.cn/deleteicon/0C80198413CC4A95A325B7BF3AB35E77.png)no-repeat;
			background-size: 34upx 34upx;
		}

		.popupNoadd {
			font-size: 30upx;
			font-weight: 500;
			color: #333333;
			line-height: 42upx;
			margin: 10upx 0 18upx 0;
		}

		.noaddView {
			min-width: 120upx;
			height: 50upx;
			display: inline-block;
			margin: 0 20upx 40upx 0;
			background: #2EA7E0;
			border-radius: 3upx;
			line-height: 50upx;
			text-align: center;
			font-size: 28upx;
			font-weight: 400;
			color: #FFFFFF;
			padding: 0 30rpx;
		}
	}

	.missionView {
		padding: 23upx 0 27upx;
		width: 716upx;
		margin: 0 auto;
		background: url(http://static.bsyjk.cn/wzbg/0C3E40EE999042308BEF57E2A1010C37.png)no-repeat;
		background-size: 100% 100%;
		box-sizing: border-box;
		box-shadow: 0px 12upx 24upx 0px rgba(0, 0, 0, 0.06);
		position: relative;

		.fxw670 {
			width: 670upx;
			margin: 24upx auto 0;
			padding: 22upx 22upx 5upx 22upx;
			box-sizing: border-box;
			background: #fff;
			border-radius: 16upx;

			.causeTitle {
				display: inline-block;
				padding: 0 40upx;
				height: 38upx;
				font-size: 24upx;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 38upx;
				background: #FF8F1F;
				border-radius: 4upx;
				margin-bottom: 8upx;
			}

			.causeContent {
				font-size: 28upx;
				font-weight: 400;
				color: #333333;
				line-height: 44upx;
			}
		}
	}

	.swiper {
		margin-top: 40upx;
		height: 400upx;

		.bloodGlucose {
			width: 54upx;
			height: 6upx;
			background: #4A4A4A;
			border-radius: 3upx;
			margin-top: 10upx;
		}

		.itemview {
			width: 293upx;
			height: 288upx;
			box-shadow: 0upx 2upx 20upx 0upx rgba(173, 173, 173, 0.25);
			border-radius: 40upx;
			margin: 0 auto;

			.itemImage {
				width: 60upx;
				height: 60upx;
				display: block;
				float: left;
				margin: 24upx 13upx 13upx 30upx;
			}

			.itemTitle {
				font-size: 30upx;
				font-weight: 500;
				color: #FFFFFF;
				padding-top: 30upx;
			}
		}

		.bgfView {
			width: 254upx;
			height: 171upx;
			padding: 16upx;
			background: #FFFFFF;
			box-shadow: 0px 2upx 15upx 0px rgba(0, 0, 0, 0.15);
			border-radius: 15upx;
			margin: 0 auto;
			box-sizing: border-box;
			font-size: 34upx;

			.ctitle1 {
				color: #051D3F;
			}

			.ctitle1,
			.unit1 {
				font-size: 20upx;
			}
		}

		.itemButton {
			width: 117upx;
			height: 44upx;
			border-radius: 27upx;
			font-size: 24upx;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 33upx;
			padding: 0;
			line-height: 44upx;
			text-align: left;
			text-indent: 20upx;
			position: relative;
			top: 34upx;
			float: left;
			z-index: 1;
		}

		.dot {
			position: relative;
			width: 14upx;
			height: 14upx;
			border-radius: 50%;
			top: 52upx;
			left: 220upx;

			.line {
				width: 150upx;
				position: absolute;
				top: 6upx;
				right: 0;
			}
		}

		.conter {
			.dot {
				position: relative;
				width: 14upx;
				height: 14upx;
				border-radius: 50%;
				top: 52upx;
				left: 240upx;

				.line {
					width: 150upx;
					position: absolute;
					top: 6upx;
					right: 0;
				}
			}

			.bgfView {
				width: 297upx;
				height: 215upx;
				background: #FFFFFF;
				box-shadow: 0px 2upx 15upx 0px rgba(0, 0, 0, 0.15);
				border-radius: 15upx;

				.itemButton {
					width: 136upx;
					height: 51upx;
					line-height: 51upx;
					border-radius: 27upx;
					font-size: 24upx;
					font-weight: 500;
					color: #FFFFFF;
				}
			}

			width: 343upx;
			height: 338upx;
		}
	}

	.topbg {
		width: 750upx;
		height: 568upx;
		background: url(http://static.bsyjk.cn/jlbgtopimage/B9652396AD964395A4278601F6516881.png)no-repeat #fff;
		background-size: 750upx 333upx;
		padding-top: 108upx;
		box-sizing: border-box;
	}

	.facility {
		height: 87upx;
		margin: -50rpx 0 0;

		scroll-view {
			white-space: nowrap;
			display: flex;
		}

		.view_biy {
			display: inline-block;
			font-size: 30upx;
			font-weight: 500;
			color: #2EA7E0;
			line-height: 15upx;
			height: 87upx;
			line-height: 87upx;
			background: #fff;
			margin-left: 20upx;
			border-radius: 59upx;
			padding-right: 14upx;

			.biy_img {
				width: 69upx;
				height: 69upx;
				display: block;
				float: left;
				margin: 12upx 9upx 0 14upx;
			}
		}
	}

	.pressView {
		width: 717upx;
		background: #FFFFFF;
		box-shadow: 0px 2upx 20upx 0px rgba(173, 173, 173, 0.25);
		border-radius: 22upx;
		margin: 29upx auto 0;
		font-size: 30upx;
		color: #0D0E10;

		.weui-flex {
			height: 146upx;
			line-height: 146upx;

			.time_sty {
				padding-left: 26upx;
			}

			.type_sty {
				padding: 0 42upx 0 10upx;
			}

			.weightArrow,
			.weightArrowRotate {
				padding-right: 80rpx;
				position: relative;
			}

			.weightArrow::before {
				content: '';
				width: 36rpx;
				height: 36rpx;
				position: absolute;
				right: 30rpx;
				top: 60rpx;
				background: url(https://bsyjk-pic.bsyjk.cn/arrows/1CB6DDEEB08E4CE0A40E8E86A99D1A0D.png) no-repeat;
				background-size: 36rpx 36rpx;
			}

			.weightArrowRotate::before {
				content: '';
				width: 36rpx;
				height: 36rpx;
				transform: rotate(90deg);
				position: absolute;
				right: 30rpx;
				top: 60rpx;
				background: url(https://bsyjk-pic.bsyjk.cn/arrows/1CB6DDEEB08E4CE0A40E8E86A99D1A0D.png) no-repeat;
				background-size: 36rpx 36rpx;
			}

			.num_sty {
				color: #ADADAD;
			}

			.colorF3 {
				color: #FF333A;
			}

			.color8 {
				color: #81C042;
			}

			.color2 {
				color: #2EA7E0;
			}

			.colorff9 {
				color: #FF930A;
			}

			.colorff92 {
				color: #90021F;
			}
		}
	}

	.tableView {
		width: 717upx;
		background: #FFFFFF;
		box-shadow: 0px 2upx 20upx 0px rgba(173, 173, 173, 0.25);
		border-radius: 22upx;
		margin: 29upx auto 0;

		.tableTltle {
			font-size: 24upx;
			font-weight: 400;
			color: rgba(0, 0, 0, 0.65);
			height: 54upx;
			line-height: 54upx;
			padding: 0 16upx;
		}

		.tabteshud {
			width: 143upx;
			height: 120upx;
			background: #FAFAFA;
			text-align: center;
			padding-top: 16upx;
			border-top: 1px solid rgb(228, 231, 237);
		}
	}

	.foodstyle {
		width: 670upx;
		padding: 20upx;
		background: #FFFFFF;
		border-radius: 16upx;
		border: 1upx solid #E2E1E2;
		box-sizing: border-box;
		margin: 20upx auto 0;

		.foodImage {
			width: 100upx;
			height: 100upx;
			background: pink;
			border-radius: 10upx;
			margin-right: 20upx;
		}

		.wtitle {
			width: 460upx;
			font-size: 30upx;
			font-weight: 500;
			color: #4A4A4A;
			line-height: 42upx;
			margin-top: 8upx;
		}

		.itmweight {
			font-size: 24upx;
			font-weight: 400;
			color: #9B9B9B;
			line-height: 33upx;
			margin-right: 10upx;
		}

		.arrows {
			width: 18upx;
			height: 32upx;
			position: relative;
			top: 30upx;
			background: url(https://bsyjk-pic.bsyjk.cn/arrows/1CB6DDEEB08E4CE0A40E8E86A99D1A0D.png)no-repeat;
			background-size: 18upx 32upx;
		}
	}

	.topxxiys {
		font-size: 22upx;
		font-weight: 400;
		color: #333333;
		line-height: 51upx;
		padding-bottom: 14upx;

		.titleS {
			color: #9B9B9B;
			padding-right: 10upx;
		}
	}

	.causeTitle2 {
		display: inline-block;
		padding: 0 40rpx;
		height: 38rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 38rpx;
		background: #FF8F1F;
		-webkit-border-radius: 4rpx;
		border-radius: 4rpx;
		margin-bottom: 8rpx;

	}

	.switch-flex {
		display: flex;
		padding-bottom: 10rpx;

		.flex-leftTitle {
			font-size: 28rpx;
			color: #2EA7E0;
			padding: 24rpx 24rpx 0 24rpx;
		}

		.r-flexTab {
			display: flex;
			padding: 18rpx 24rpx 0 24rpx;
			transform: translateY(-10rpx);

			.tab-view {
				padding: 18rpx 20rpx;
				background: #F5F5F5;
			}

			.tab-view:first-child {
				border-radius: 50rpx 0 0 50rpx;
			}

			.tab-view:last-child {
				border-radius: 0 50rpx 50rpx 0;
			}

			.actavetab {
				background: #2EA7E0;
				color: #F5F5F5;
			}
		}
	}

	.adddersss,
	.ladersss {
		color: #FF333A !important;
		position: relative;
	}

	.adddersss::before,
	.ladersss::before {
		content: '';
		width: 8rpx;
		height: 28rpx;
		position: absolute;
		top: 14rpx;
		right: 8rpx;
		background: url(http://static.bsyjk.cn/redjiant/0643066249B146F38477E7020CF92D11.png)no-repeat;
		background-size: 100% 100%;
	}

	.ladersss::before {
		background: url(http://static.bsyjk.cn/xiajiangjian/F38825CD7D5D449CBDB38615A46C28F5.png)no-repeat;
		background-size: 100% 100%;
	}

	.charts-box {
		width: 100%;
		height: 300px;
	}
	.topbgDis{
		height: 760rpx;
		background: url(http://static.bsyjk.cn/toprbg2/5090CDC5F7B947DDBEB2636ECCB7621F.png)no-repeat;
		background-size: 100% 100%;
	}
</style>
